Class: Travis::CLI::Sync

Inherits:
ApiCommand show all
Defined in:
lib/travis/cli/sync.rb

Instance Attribute Summary

Attributes inherited from ApiCommand

#session

Attributes inherited from Command

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

Instance Method Summary collapse

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

#runObject


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/travis/cli/sync.rb', line 10

def run
  authenticate

  if check?
    say "#{"not " unless user.syncing?}syncing", "#{user.} is currently %s"
  elsif user.syncing? and not force?
    error "user is already syncing"
  elsif background?
    say "starting synchronization"
    sync(false)
  else
    say "synchronizing: "
    sync
    say color(" done", :success)
  end
end