Class: Oncall::Core::Config
- Inherits:
-
Object
- Object
- Oncall::Core::Config
- Defined in:
- lib/oncall/core/config.rb
Constant Summary collapse
- DEFAULT_PATTERN =
'**{,/*/**}/*_oncall.rb'.freeze
Instance Method Summary collapse
- #domain ⇒ Object
- #failure_exit_code ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #pattern ⇒ Object
- #port ⇒ Object
- #set_config(config) ⇒ Object
- #set_env(env) ⇒ Object
- #test_files ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
6 7 8 9 |
# File 'lib/oncall/core/config.rb', line 6 def initialize @config = [] @env = 'develop' end |
Instance Method Details
#domain ⇒ Object
27 28 29 |
# File 'lib/oncall/core/config.rb', line 27 def domain @config[@env]['domain'] || 'localhost' end |
#failure_exit_code ⇒ Object
23 24 25 |
# File 'lib/oncall/core/config.rb', line 23 def failure_exit_code 1 end |
#pattern ⇒ Object
19 20 21 |
# File 'lib/oncall/core/config.rb', line 19 def pattern DEFAULT_PATTERN end |
#port ⇒ Object
31 32 33 |
# File 'lib/oncall/core/config.rb', line 31 def port @config[@env]['port'] || 4567 end |
#set_config(config) ⇒ Object
11 12 13 |
# File 'lib/oncall/core/config.rb', line 11 def set_config(config) @config = config end |
#set_env(env) ⇒ Object
15 16 17 |
# File 'lib/oncall/core/config.rb', line 15 def set_env(env) @env = env end |
#test_files ⇒ Object
35 36 37 |
# File 'lib/oncall/core/config.rb', line 35 def test_files Dir.glob(pattern) end |