Class: Devpack::Initializers

Inherits:
Object
  • Object
show all
Includes:
Timeable
Defined in:
lib/devpack/initializers.rb

Overview

Loads requested initializers from configuration

Instance Method Summary collapse

Methods included from Timeable

#timed

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

#loadObject



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