Class: Travis::CLI::History

Inherits:
RepoCommand show all
Defined in:
lib/travis/cli/history.rb

Constant Summary

Constants inherited from RepoCommand

RepoCommand::GIT_REGEX

Instance Attribute Summary

Attributes inherited from RepoCommand

#slug

Attributes inherited from ApiCommand

#session

Attributes inherited from Command

#arguments, #config, #force_interactive, #formatter, #input, #output

Instance Method Summary collapse

Methods inherited from RepoCommand

#repository, #setup

Methods inherited from ApiCommand

#authenticate, #detected_endpoint?, #endpoint_config, #initialize, #org?, #pro?, #setup, #sync

Methods included from Travis::Client::Methods

#access_token, #access_token=, #accounts, #api_endpoint, #api_endpoint=, #artifact, #broadcasts, #build, #cancel, #explicit_api_endpoint?, #github_auth, #job, #listen, #repo, #repos, #restart, #user, #worker, #workers

Methods inherited from Command

abstract, abstract?, #check_ruby, #check_version, command_name, #command_name, #debug, description, #execute, #help, #info, #initialize, #last_check, #on_signal, #parse, #say, #setup, skip, #terminal, #usage, #write_to

Methods included from Parser

#new, #on, #on_initialize

Constructor Details

This class inherits a constructor from Travis::CLI::ApiCommand

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/travis/cli/history.rb', line 14

def run
  countdown = Integer(limit || 10) unless all?
  params    = { :after_number => after } if after
  repository.each_build(params) do |build|
    next unless display? build
    display(build)

    if countdown
      countdown -= 1
      break if countdown < 1
    end
  end
end