class Travis::CLI::Endpoint

Public Instance Methods

run() click to toggle source
# File lib/travis/cli/endpoint.rb, line 30
def run
  github? ? run_github : run_travis
end
run_github() click to toggle source
# File lib/travis/cli/endpoint.rb, line 13
def run_github
  error "--github cannot be combined with --drop-default" if drop_default?
  error "--github cannot be combined with --set-default" if set_default?
  load_gh
  say github_endpoint.to_s, "GitHub endpoint: %s"
end
run_travis() click to toggle source
# File lib/travis/cli/endpoint.rb, line 20
def run_travis
  if drop_default? and was = config['default_endpoint']
    config.delete('default_endpoint')
    say was, "default API endpoint dropped (was %s)"
  else
    config['default_endpoint'] = api_endpoint if set_default?
    say api_endpoint, "API endpoint: %s#{" (stored as default)" if set_default?}"
  end
end