Class: TestDots::Configuration
- Inherits:
-
Object
- Object
- TestDots::Configuration
- Defined in:
- lib/test_dots/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#cacert_path ⇒ Object
Returns the value of attribute cacert_path.
-
#ci_adapter ⇒ Object
Returns the value of attribute ci_adapter.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
-
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
Instance Method Summary collapse
- #collect_test_data? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/test_dots/configuration.rb', line 5 def initialize @enabled = true @host = ENV.fetch('TEST_DOTS_HOST', 'testdots.com') @port = port = ENV.fetch('TEST_DOTS_PORT', '443') @api_key = ENV.fetch('TEST_DOTS_KEY', nil) @endpoint = ENV.fetch('TEST_DOTS_ENDPOINT', '/api/v1/builds') @use_ssl = true @cacert_path = File.(File.join('..', '..', '..', 'resources', 'cacert.pem'), __FILE__) @ci_adapter = default_ci_adapter end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/test_dots/configuration.rb', line 3 def api_key @api_key end |
#cacert_path ⇒ Object
Returns the value of attribute cacert_path.
3 4 5 |
# File 'lib/test_dots/configuration.rb', line 3 def cacert_path @cacert_path end |
#ci_adapter ⇒ Object
Returns the value of attribute ci_adapter.
3 4 5 |
# File 'lib/test_dots/configuration.rb', line 3 def ci_adapter @ci_adapter end |
#enabled ⇒ Object
Returns the value of attribute enabled.
3 4 5 |
# File 'lib/test_dots/configuration.rb', line 3 def enabled @enabled end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
3 4 5 |
# File 'lib/test_dots/configuration.rb', line 3 def endpoint @endpoint end |
#host ⇒ Object
Returns the value of attribute host.
3 4 5 |
# File 'lib/test_dots/configuration.rb', line 3 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
3 4 5 |
# File 'lib/test_dots/configuration.rb', line 3 def port @port end |
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
3 4 5 |
# File 'lib/test_dots/configuration.rb', line 3 def use_ssl @use_ssl end |
Instance Method Details
#collect_test_data? ⇒ Boolean
16 17 18 |
# File 'lib/test_dots/configuration.rb', line 16 def collect_test_data? enabled && api_key end |