Module: Jammit::Config
- Defined in:
- lib/jammit-core/config.rb
Constant Summary collapse
Class Method Summary collapse
- .dispatch(command, *params) ⇒ Object
-
.load(force = false) ⇒ Object
load configuration file.
Class Method Details
.dispatch(command, *params) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/jammit-core/config.rb', line 8 def dispatch(command, *params) case command when :create create when :set set(params.shift, params.shift) end end |
.load(force = false) ⇒ Object
load configuration file
22 23 24 25 26 27 28 |
# File 'lib/jammit-core/config.rb', line 22 def load(force=false) raise Jammit::ConfigurationNotFound, "could not find the \"#{Jammit.config_path}\" configuration file" unless File.exists?(Jammit.config_path) && File.readable?(Jammit.config_path) if !@config || force == true @config = YAML.load(ERB.new(File.read(Jammit.config_path)).result) end @config end |