class Spore::Railtie

Spore Railtie for using Spore to load environment from a file into Rails applications

Public Class Methods

load() click to toggle source

Rails uses ‘#method_missing` to delegate all class methods to the instance, which means `Kernel#load` gets called here. We don’t want that.

# File lib/spore/rails.rb, line 39
def self.load
  instance.load
end

Public Instance Methods

load() click to toggle source

Public: Load spore

This will get called during the ‘before_configuration` callback, but you can manually call `Spore::Railtie.load` if you needed it sooner.

# File lib/spore/rails.rb, line 26
def load
  Spore.load
end
root() click to toggle source

Internal: ‘Rails.root` is nil in Rails 4.1 before the application is initialized, so this falls back to the `RAILS_ROOT` environment variable, or the current working directory.

# File lib/spore/rails.rb, line 33
def root
  Rails.root || Pathname.new(ENV["RAILS_ROOT"] || Dir.pwd)
end