Class: CircleCI::CoverageReporter::Configuration
- Inherits:
-
Object
- Object
- CircleCI::CoverageReporter::Configuration
- Defined in:
- lib/circleci/coverage_reporter/configuration.rb
Constant Summary collapse
- DEFAULT_REPORTERS =
[ Reporters::SimpleCov.new, Reporters::Flow.new, Reporters::RubyCritic.new ].freeze
- DEFAULT_VCS_TYPE =
'github'.freeze
Instance Attribute Summary collapse
- #artifacts_dir ⇒ String
- #base_revision ⇒ String
-
#circleci_token ⇒ Object
Returns the value of attribute circleci_token.
- #current_build_number ⇒ Integer
- #current_revision ⇒ String
- #previous_build_number ⇒ Integer?
- #reporters ⇒ Array<Reporters::Base>
- #repository_name ⇒ String
-
#template ⇒ Object
writeonly
Sets the attribute template.
-
#template_safe_mode ⇒ Object
writeonly
Sets the attribute template_safe_mode.
- #user_name ⇒ String
-
#vcs_token ⇒ Object
Returns the value of attribute vcs_token.
- #vcs_type ⇒ String
Instance Method Summary collapse
Instance Attribute Details
#artifacts_dir ⇒ String
35 36 37 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 35 def artifacts_dir @artifacts_dir ||= ENV['CIRCLE_ARTIFACTS'] end |
#base_revision ⇒ String
40 41 42 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 40 def base_revision @base_revision ||= `git merge-base origin/master HEAD`.strip end |
#circleci_token ⇒ Object
Returns the value of attribute circleci_token.
15 16 17 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 15 def circleci_token @circleci_token end |
#current_build_number ⇒ Integer
45 46 47 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 45 def current_build_number @current_build_number ||= ENV['CIRCLE_BUILD_NUM'] end |
#current_revision ⇒ String
50 51 52 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 50 def current_revision @current_revision ||= ENV['CIRCLE_SHA1'] end |
#previous_build_number ⇒ Integer?
55 56 57 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 55 def previous_build_number @previous_build_number ||= ENV['CIRCLE_PREVIOUS_BUILD_NUM'] && ENV['CIRCLE_PREVIOUS_BUILD_NUM'].to_i end |
#reporters ⇒ Array<Reporters::Base>
25 26 27 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 25 def reporters @reporters ||= DEFAULT_REPORTERS.dup end |
#repository_name ⇒ String
60 61 62 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 60 def repository_name @repository_name ||= ENV['CIRCLE_PROJECT_REPONAME'] end |
#template=(value) ⇒ Object (writeonly)
Sets the attribute template
16 17 18 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 16 def template=(value) @template = value end |
#template_safe_mode=(value) ⇒ Object (writeonly)
Sets the attribute template_safe_mode
16 17 18 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 16 def template_safe_mode=(value) @template_safe_mode = value end |
#user_name ⇒ String
65 66 67 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 65 def user_name @user_name ||= ENV['CIRCLE_PROJECT_USERNAME'] end |
#vcs_token ⇒ Object
Returns the value of attribute vcs_token.
15 16 17 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 15 def vcs_token @vcs_token end |
#vcs_type ⇒ String
30 31 32 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 30 def vcs_type @vcs_type ||= DEFAULT_VCS_TYPE end |
Instance Method Details
#dump ⇒ void
This method returns an undefined value.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 70 def dump # rubocop:disable AbcSize puts <<~EOF Configuration | Value ----------------------|---------------------------------------------------------------------------- artifacts_dir | #{artifacts_dir.inspect} base_revision | #{base_revision.inspect} circleci_token | #{circleci_token[-4..-1].rjust(40, '*').inspect} current_build_number | #{current_build_number.inspect} current_revision | #{current_revision.inspect} previous_build_number | #{previous_build_number.inspect} reporters | #{reporters.inspect} repository_name | #{repository_name.inspect} user_name | #{user_name.inspect} vcs_token | #{vcs_token[-4..-1].rjust(40, '*').inspect} vcs_type | #{vcs_type.inspect} EOF end |
#project ⇒ String
20 21 22 |
# File 'lib/circleci/coverage_reporter/configuration.rb', line 20 def project "#{user_name}/#{repository_name}" end |