Class: Devpack::Initializers
- Inherits:
-
Object
- Object
- Devpack::Initializers
- Includes:
- Timeable
- Defined in:
- lib/devpack/initializers.rb
Overview
Loads requested initializers from configuration
Instance Method Summary collapse
-
#initialize(config) ⇒ Initializers
constructor
A new instance of Initializers.
- #load ⇒ Object
Methods included from Timeable
Constructor Details
#initialize(config) ⇒ Initializers
Returns a new instance of Initializers.
8 9 10 |
# File 'lib/devpack/initializers.rb', line 8 def initialize(config) @config = config end |
Instance Method Details
#load ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/devpack/initializers.rb', line 12 def load initializers, time = timed { load_initializers } path = @config.devpack_initializers_path return if path.nil? args = path, initializers, time.round(2) Devpack.warn(:success, Messages.loaded_initializers(*args)) end |