Class: ConfigStore
- Inherits:
-
Object
- Object
- ConfigStore
- Defined in:
- lib/config_store.rb
Constant Summary collapse
- @@defaults_path =
File.join(File.dirname(__FILE__),'../config/defaults.json')
- @@overrides_path =
File.('~/.config/api_deploy_overrides.json')
Class Method Summary collapse
- .artifactory ⇒ Object
- .bitbucket ⇒ Object
- .defaults_path ⇒ Object
- .defaults_path=(path) ⇒ Object
- .load_config ⇒ Object
- .octopus ⇒ Object
- .overrides_path ⇒ Object
- .overrides_path=(path) ⇒ Object
- .set_config ⇒ Object
- .teamcity ⇒ Object
Class Method Details
.artifactory ⇒ Object
30 |
# File 'lib/config_store.rb', line 30 def artifactory; @@ConfigStore.artifactory; end |
.bitbucket ⇒ Object
32 |
# File 'lib/config_store.rb', line 32 def bitbucket; @@ConfigStore.bitbucket; end |
.defaults_path ⇒ Object
5 6 7 |
# File 'lib/config_store.rb', line 5 def self.defaults_path @@defaults_path end |
.defaults_path=(path) ⇒ Object
9 10 11 |
# File 'lib/config_store.rb', line 9 def self.defaults_path=(path) @@defaults_path = path end |
.load_config ⇒ Object
21 22 23 24 25 26 |
# File 'lib/config_store.rb', line 21 def self.load_config warn "ConfigStoreuration overrides file not present at #{overrides_path}" unless File.exists?(overrides_path) defaults = Hashie::Mash.new(JSON.parse(File.read(defaults_path))) if File.exists?(defaults_path) overrides = JSON.parse(File.read(overrides_path)) if File.exists?(overrides_path) defaults.deep_merge(overrides || {}) end |
.octopus ⇒ Object
31 |
# File 'lib/config_store.rb', line 31 def octopus; @@ConfigStore.octopus; end |
.overrides_path ⇒ Object
13 14 15 |
# File 'lib/config_store.rb', line 13 def self.overrides_path @@overrides_path end |
.overrides_path=(path) ⇒ Object
17 18 19 |
# File 'lib/config_store.rb', line 17 def self.overrides_path=(path) @@overrides_path = path end |
.set_config ⇒ Object
35 36 37 |
# File 'lib/config_store.rb', line 35 def self.set_config @@ConfigStore = self.load_config end |
.teamcity ⇒ Object
29 |
# File 'lib/config_store.rb', line 29 def teamcity; @@ConfigStore.teamcity; end |