Class: CircleCI::CoverageReporter::Configuration

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

Constant Summary collapse

DEFAULT_REPORTERS =
[SimpleCov::Reporter.new].freeze
DEFAULT_VCS_TYPE =
'github'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#artifacts_dirString

Returns:

  • (String)


29
30
31
# File 'lib/circleci/coverage_reporter/configuration.rb', line 29

def artifacts_dir
  @artifacts_dir ||= ENV['CIRCLE_ARTIFACTS']
end

#base_revisionString

Returns:

  • (String)


34
35
36
# File 'lib/circleci/coverage_reporter/configuration.rb', line 34

def base_revision
  @base_revision ||= `git merge-base origin/master HEAD`.strip
end

#circleci_tokenObject

Returns the value of attribute circleci_token.



9
10
11
# File 'lib/circleci/coverage_reporter/configuration.rb', line 9

def circleci_token
  @circleci_token
end

#current_build_numberInteger

Returns:

  • (Integer)


39
40
41
# File 'lib/circleci/coverage_reporter/configuration.rb', line 39

def current_build_number
  @current_build_number ||= ENV['CIRCLE_BUILD_NUM']
end

#current_revisionString

Returns:

  • (String)


44
45
46
# File 'lib/circleci/coverage_reporter/configuration.rb', line 44

def current_revision
  @current_revision ||= ENV['CIRCLE_SHA1']
end

#previous_build_numberInteger

Returns:

  • (Integer)


49
50
51
# File 'lib/circleci/coverage_reporter/configuration.rb', line 49

def previous_build_number
  @previous_build_number ||= ENV['CIRCLE_PREVIOUS_BUILD_NUM'].to_i
end

#reportersArray<AbstractReporter>

Returns:



19
20
21
# File 'lib/circleci/coverage_reporter/configuration.rb', line 19

def reporters
  @reporters ||= DEFAULT_REPORTERS
end

#repository_nameString

Returns:

  • (String)


54
55
56
# File 'lib/circleci/coverage_reporter/configuration.rb', line 54

def repository_name
  @repository_name ||= ENV['CIRCLE_PROJECT_REPONAME']
end

#user_nameString

Returns:

  • (String)


59
60
61
# File 'lib/circleci/coverage_reporter/configuration.rb', line 59

def user_name
  @user_name ||= ENV['CIRCLE_PROJECT_USERNAME']
end

#vcs_tokenObject

Returns the value of attribute vcs_token.



9
10
11
# File 'lib/circleci/coverage_reporter/configuration.rb', line 9

def vcs_token
  @vcs_token
end

#vcs_typeString

Returns:

  • (String)


24
25
26
# File 'lib/circleci/coverage_reporter/configuration.rb', line 24

def vcs_type
  @vcs_type ||= DEFAULT_VCS_TYPE
end

Instance Method Details

#projectString

Returns:

  • (String)


14
15
16
# File 'lib/circleci/coverage_reporter/configuration.rb', line 14

def project
  "#{user_name}/#{repository_name}"
end