Class: ErisConfig
- Inherits:
-
Object
- Object
- ErisConfig
- Defined in:
- lib/eris/lib/eris_config.rb
Instance Method Summary collapse
- #enyo_js_path ⇒ Object
- #enyo_root ⇒ Object
- #enyo_root_for_environment ⇒ Object
- #enyo_version ⇒ Object
-
#initialize(opts) ⇒ ErisConfig
constructor
A new instance of ErisConfig.
Constructor Details
#initialize(opts) ⇒ ErisConfig
Returns a new instance of ErisConfig.
6 7 8 9 |
# File 'lib/eris/lib/eris_config.rb', line 6 def initialize(opts) @config_hash = JSON.parse(File.read(opts[:config_path])) @app_root = opts[:app_root] end |
Instance Method Details
#enyo_js_path ⇒ Object
27 28 29 |
# File 'lib/eris/lib/eris_config.rb', line 27 def enyo_js_path "usr/palm/frameworks/enyo/#{enyo_version}/framework/enyo.js" end |
#enyo_root ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/eris/lib/eris_config.rb', line 15 def enyo_root if Pathname.new(enyo_root_for_environment).absolute? enyo_root_for_environment else File.join(@app_root, enyo_root_for_environment) end end |
#enyo_root_for_environment ⇒ Object
11 12 13 |
# File 'lib/eris/lib/eris_config.rb', line 11 def enyo_root_for_environment ENV['IS_CI_BOX'] == "true" ? @config_hash['ciEnyoRoot'] : @config_hash['localEnyoRoot'] end |
#enyo_version ⇒ Object
23 24 25 |
# File 'lib/eris/lib/eris_config.rb', line 23 def enyo_version @config_hash['enyoVersion'] || "0.10" end |