Class: Travis::CLI::Logs

Inherits:
RepoCommand show all
Includes:
Tools::SafeString
Defined in:
lib/travis/cli/logs.rb

Constant Summary

Constants inherited from RepoCommand

RepoCommand::GIT_REGEX, RepoCommand::TRAVIS

Constants inherited from Command

Command::DAY, Command::HOUR, Command::MINUTE, Command::WEEK

Constants included from Tools::Assets

Tools::Assets::BASE

Instance Attribute Summary

Attributes inherited from RepoCommand

#slug

Attributes inherited from ApiCommand

#enterprise_name, #session

Attributes inherited from Command

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

Instance Method Summary collapse

Methods included from Tools::SafeString

#clean, #colorized, #encoded

Methods inherited from RepoCommand

#repository

Methods inherited from ApiCommand

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

Methods included from Travis::Client::Methods

#access_token, #access_token=, #account, #accounts, #api_endpoint, #api_endpoint=, #artifact, #broadcasts, #build, #cancel, #explicit_api_endpoint?, #github_auth, #hooks, #listen, #repo, #repos, #restart, #user

Methods inherited from Command

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

Methods included from Tools::Assets

#asset, #asset_path

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



16
17
18
19
20
# File 'lib/travis/cli/logs.rb', line 16

def run(number = last_build.number)
  job ||= job(number) || error("no such job ##{number}")
  info "displaying logs for #{color(job.inspect_info, [:bold, :info])}"
  job.log.body { |part| print interactive? ? encoded(part) : clean(part) }
end

#setupObject



10
11
12
13
# File 'lib/travis/cli/logs.rb', line 10

def setup
  super
  check_websocket
end