Class: Travis::CLI::Restart

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

Constant Summary

Constants inherited from RepoCommand

Travis::CLI::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=, #api_endpoint, #api_endpoint=, #artifact, #build, #explicit_api_endpoint?, #github_auth, #job, #repo, #repos, #restart, #user, #worker, #workers

Methods inherited from Command

abstract, abstract?, command_name, #command_name, #debug, #execute, #help, #initialize, #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

#run(number = last_build.number) ⇒ Object


6
7
8
9
10
11
# File 'lib/travis/cli/restart.rb', line 6

def run(number = last_build.number)
  entity = job(number) || build(number)
  entity.restart

  say "restarted", "#{entity.class.one} ##{entity.number} has been %s"
end