Class: Coveralls::CommandLine

Inherits:
Thor
  • Object
show all
Defined in:
lib/coveralls/command.rb

Instance Method Summary collapse

Instance Method Details

#lastObject



47
48
49
# File 'lib/coveralls/command.rb', line 47

def last
  open_token_based_url 'https://coveralls.io/repos/%@/last_build'
end

#openObject



37
38
39
# File 'lib/coveralls/command.rb', line 37

def open
  open_token_based_url 'https://coveralls.io/repos/%@'
end

#pushObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/coveralls/command.rb', line 8

def push
  return unless ensure_can_run_locally!

  ENV['COVERALLS_RUN_LOCALLY'] = 'true'
  cmds = ['bundle exec rake']

  if File.exist?('.travis.yml')
    cmds = begin
      YAML.load_file('.travis.yml')['script'] || cmds
    rescue StandardError
      cmds
    end
  end

  cmds.each { |cmd| system cmd }

  ENV['COVERALLS_RUN_LOCALLY'] = nil
end

#reportObject



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

def report
  ENV['COVERALLS_NOISY'] = 'true'

  exec 'bundle exec rake'

  ENV['COVERALLS_NOISY'] = nil
end

#serviceObject



42
43
44
# File 'lib/coveralls/command.rb', line 42

def service
  open_token_based_url 'https://coveralls.io/repos/%@/service'
end

#versionObject



52
53
54
# File 'lib/coveralls/command.rb', line 52

def version
  Coveralls::Output.puts Coveralls::VERSION
end