Class: Praxis::BootloaderStages::FileLoader
- Defined in:
- lib/praxis/bootloader_stages/file_loader.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from Stage
#after_callbacks, #before_callbacks, #context, #name, #stages
Instance Method Summary collapse
- #callback_args ⇒ Object
- #execute ⇒ Object
-
#initialize(name, application, path: nil) ⇒ FileLoader
constructor
A new instance of FileLoader.
Methods inherited from Stage
#after, #application, #before, #execute_callbacks, #run, #setup!, #setup_deferred_callbacks!
Constructor Details
#initialize(name, application, path: nil) ⇒ FileLoader
Returns a new instance of FileLoader.
8 9 10 11 |
# File 'lib/praxis/bootloader_stages/file_loader.rb', line 8 def initialize(name, application, path: nil) super @path = path || Array(name) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/praxis/bootloader_stages/file_loader.rb', line 6 def path @path end |
Instance Method Details
#callback_args ⇒ Object
23 24 25 |
# File 'lib/praxis/bootloader_stages/file_loader.rb', line 23 def callback_args application.file_layout[*path] end |
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/praxis/bootloader_stages/file_loader.rb', line 13 def execute application.file_layout[*path].each do |file| next if application.loaded_files.include?(file) next unless file.extname == '.rb' require file application.loaded_files << file end end |