Class: OyenCov::Configuration
- Inherits:
-
Object
- Object
- OyenCov::Configuration
- Defined in:
- lib/oyencov/configuration.rb
Constant Summary collapse
- ENV_PARAMETERS =
%w[ API_KEY API_URL MODE RELEASE TEST_REPORTING_DIR TEST_RESULTSET_PATH PROGRAM_NAME ]
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#api_url ⇒ Object
readonly
Returns the value of attribute api_url.
-
#excluding_file_paths ⇒ Object
readonly
Returns the value of attribute excluding_file_paths.
-
#including_file_paths ⇒ Object
readonly
Returns the value of attribute including_file_paths.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#process_type ⇒ Object
readonly
Returns the value of attribute process_type.
-
#program_name ⇒ Object
readonly
Returns the value of attribute program_name.
-
#release ⇒ Object
readonly
Returns the value of attribute release.
-
#test_reporting_dir ⇒ Object
readonly
Returns the value of attribute test_reporting_dir.
-
#test_resultset_path ⇒ Object
readonly
Returns the value of attribute test_resultset_path.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset_to_defaults ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/oyencov/configuration.rb', line 18 def initialize reset_to_defaults ENV_PARAMETERS.each do |key| if (envvar_value = ENV["OYENCOV_#{key}"]) instance_variable_set( :"@#{key.downcase}", envvar_value ) end end end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
16 17 18 |
# File 'lib/oyencov/configuration.rb', line 16 def api_key @api_key end |
#api_url ⇒ Object (readonly)
Returns the value of attribute api_url.
16 17 18 |
# File 'lib/oyencov/configuration.rb', line 16 def api_url @api_url end |
#excluding_file_paths ⇒ Object (readonly)
Returns the value of attribute excluding_file_paths.
16 17 18 |
# File 'lib/oyencov/configuration.rb', line 16 def excluding_file_paths @excluding_file_paths end |
#including_file_paths ⇒ Object (readonly)
Returns the value of attribute including_file_paths.
16 17 18 |
# File 'lib/oyencov/configuration.rb', line 16 def including_file_paths @including_file_paths end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
16 17 18 |
# File 'lib/oyencov/configuration.rb', line 16 def mode @mode end |
#process_type ⇒ Object (readonly)
Returns the value of attribute process_type.
16 17 18 |
# File 'lib/oyencov/configuration.rb', line 16 def process_type @process_type end |
#program_name ⇒ Object (readonly)
Returns the value of attribute program_name.
16 17 18 |
# File 'lib/oyencov/configuration.rb', line 16 def program_name @program_name end |
#release ⇒ Object (readonly)
Returns the value of attribute release.
16 17 18 |
# File 'lib/oyencov/configuration.rb', line 16 def release @release end |
#test_reporting_dir ⇒ Object (readonly)
Returns the value of attribute test_reporting_dir.
16 17 18 |
# File 'lib/oyencov/configuration.rb', line 16 def test_reporting_dir @test_reporting_dir end |
#test_resultset_path ⇒ Object (readonly)
Returns the value of attribute test_resultset_path.
16 17 18 |
# File 'lib/oyencov/configuration.rb', line 16 def test_resultset_path @test_resultset_path end |
Instance Method Details
#reset_to_defaults ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/oyencov/configuration.rb', line 29 def reset_to_defaults @api_key = nil @api_url = "https://telemetry-api.oyencov.com" @mode = ENV["OYENCOV_ENV"] || ENV["RAILS_ENV"] @including_file_paths = %w[app lib] @excluding_file_paths = [] @release = suggest_release @process_type = suggest_process_type @test_reporting_dir = "coverage/" @test_resultset_path = "coverage/oyencov-resultset.json" end |