Class: TestDots::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/test_dots/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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.expand_path(File.join('..', '..', '..', 'resources', 'cacert.pem'), __FILE__)
  @ci_adapter = default_ci_adapter
end

Instance Attribute Details

#api_keyObject

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_pathObject

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_adapterObject

Returns the value of attribute ci_adapter.



3
4
5
# File 'lib/test_dots/configuration.rb', line 3

def ci_adapter
  @ci_adapter
end

#enabledObject

Returns the value of attribute enabled.



3
4
5
# File 'lib/test_dots/configuration.rb', line 3

def enabled
  @enabled
end

#endpointObject

Returns the value of attribute endpoint.



3
4
5
# File 'lib/test_dots/configuration.rb', line 3

def endpoint
  @endpoint
end

#hostObject

Returns the value of attribute host.



3
4
5
# File 'lib/test_dots/configuration.rb', line 3

def host
  @host
end

#portObject

Returns the value of attribute port.



3
4
5
# File 'lib/test_dots/configuration.rb', line 3

def port
  @port
end

#use_sslObject

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

Returns:

  • (Boolean)


16
17
18
# File 'lib/test_dots/configuration.rb', line 16

def collect_test_data?
  enabled && api_key
end