Class: Dotenv::Railtie
- Inherits:
-
Rails::Railtie
- Object
- Rails::Railtie
- Dotenv::Railtie
- Defined in:
- lib/dotenv/rails.rb
Class Method Summary collapse
-
.load ⇒ Object
Rails uses ‘#method_missing` to delegate all class methods to the instance, which means `Kernel#load` gets called here.
Instance Method Summary collapse
-
#load ⇒ Object
Public: Load dotenv.
Class Method Details
.load ⇒ Object
Rails uses ‘#method_missing` to delegate all class methods to the instance, which means `Kernel#load` gets called here. We don’t want that.
23 24 25 |
# File 'lib/dotenv/rails.rb', line 23 def self.load instance.load end |
Instance Method Details
#load ⇒ Object
Public: Load dotenv
This will get called during the ‘before_configuration` callback, but you can manually call `Dotenv::Railtie.load` if you needed it sooner.
16 17 18 19 |
# File 'lib/dotenv/rails.rb', line 16 def load Dotenv.load Rails.root.join('.env') Spring.watch Rails.root.join('.env') if defined?(Spring) end |