module Thermite::Rails

Constants

VERSION

Public Class Methods

find_root(root_path) { |dir| ... } click to toggle source

@param root_path [String] @return [String] Path to the root of the (Rails) project.

# File lib/thermite/rails.rb, line 10
def self.find_root(root_path)
  root = File.expand_path(root_path)

  dir = root

  loop do
    return dir if yield(dir)

    new_dir = File.dirname(dir)
    raise "Unable to find root for #{root}" if new_dir == dir

    dir = new_dir
  end
end
root_project() click to toggle source

@return [Thermite::Rails::RootProject]

# File lib/thermite/rails.rb, line 26
def self.root_project
  require_relative 'rails/root_project'
  @root_project ||= Thermite::Rails::RootProject.new(::Rails.root.to_s)
end