Class: Xccoveralls::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/xccoveralls/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo_token: nil, derived_data_path: nil, source_path: nil, ignorefile_path: nil) ⇒ Runner

Returns a new instance of Runner.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/xccoveralls/runner.rb', line 11

def initialize(
  repo_token: nil, derived_data_path: nil,
  source_path: nil, ignorefile_path: nil
)
  options = {
    derived_data_path: derived_data_path,
    source_path: source_path, ignorefile_path: ignorefile_path
  }
  @xccov = Xccoveralls::Xccov.new(options)
  @repo_token = repo_token

  FastlaneCore::PrintTable.print_values(
    config: options,
    title: "Summary for #{Xccoveralls::NAME} #{Xccoveralls::VERSION}"
  )
end

Instance Attribute Details

#coveralls_configurationObject (readonly)

Returns the value of attribute coveralls_configuration.



9
10
11
# File 'lib/xccoveralls/runner.rb', line 9

def coveralls_configuration
  @coveralls_configuration
end

#repo_tokenObject (readonly)

Returns the value of attribute repo_token.



7
8
9
# File 'lib/xccoveralls/runner.rb', line 7

def repo_token
  @repo_token
end

#xccovObject (readonly)

Returns the value of attribute xccov.



8
9
10
# File 'lib/xccoveralls/runner.rb', line 8

def xccov
  @xccov
end

Instance Method Details

#run!Object



28
29
30
31
32
33
34
# File 'lib/xccoveralls/runner.rb', line 28

def run!
  org_repo_token = ENV['COVERALLS_REPO_TOKEN']
  ENV['COVERALLS_REPO_TOKEN'] = repo_token || org_repo_token
  @coveralls_configuration = Coveralls::Configuration.configuration
  Coveralls::API.post_json 'jobs', xccov.to_json
  ENV['COVERALLS_REPO_TOKEN'] = org_repo_token
end