Module: Jewelbox
- Defined in:
- lib/jewelbox/config.rb,
lib/jewelbox/command.rb,
lib/jewelbox/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.0.3"
Class Method Summary collapse
-
.config ⇒ Object
Description All configuration files can be accessed through this.
-
.service_init ⇒ Object
Description Configure the current process with the configuration items stored in conf/service.yml file from the current working directory.
Class Method Details
.config ⇒ Object
Description
All configuration files can be accessed through this.
39 40 41 |
# File 'lib/jewelbox/config.rb', line 39 def self.config @config ||= Config.new end |
.service_init ⇒ Object
Description
Configure the current process with the configuration items stored in conf/service.yml file from the current working directory.
Parameters
None
Returns
After this call, you can access the following configuration items
Jewelbox.config.service.name => name of the service (e.g. “taskmon”) Jewelbox.config.service.root_dir => everything else is relative to this Jewelbox.config.service.conf_dir Jewelbox.config.service.log_dir Jewelbox.config.service.bin_dir Jewelbox.config.service.lib_dir
Also anything that’s in service.yml will be accessible from Jewelbox::Service.config object.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jewelbox/config.rb', line 25 def self.service_init @service_root = ENV['SERVICE_ROOT'] || Dir.pwd Config.load(File.join(@service_root,'conf','service.yml')) @config.add('service', 'root_dir', @service_root) @config.add('service', 'conf_dir', File.join(@service_root, 'conf')) @config.add('service', 'log_dir', File.join(@service_root, 'log')) @config.add('service', 'bin_dir', File.join(@service_root, 'bin')) @config.add('service', 'lib_dir', File.join(@service_root, 'lib')) @config end |