Class: CanvasERD::ApplicationLoader
- Inherits:
-
Object
- Object
- CanvasERD::ApplicationLoader
- Defined in:
- lib/canvas_erd/application_loader.rb
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(root = Dir.pwd) ⇒ ApplicationLoader
constructor
A new instance of ApplicationLoader.
- #load ⇒ Object
Constructor Details
#initialize(root = Dir.pwd) ⇒ ApplicationLoader
Returns a new instance of ApplicationLoader.
9 10 11 |
# File 'lib/canvas_erd/application_loader.rb', line 9 def initialize(root = Dir.pwd) @root = File.(root) end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
7 8 9 |
# File 'lib/canvas_erd/application_loader.rb', line 7 def root @root end |
Instance Method Details
#load ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/canvas_erd/application_loader.rb', line 13 def load environment_path = File.join(root, "config", "environment.rb") unless File.file?(environment_path) raise Error, "Rails application environment not found at #{environment_path}" end require environment_path eager_load_rails_application true end |