lib/travis/cli/api_command.rb in travis-1.13.3 vs lib/travis/cli/api_command.rb in travis-1.14.0

- old
+ new

@@ -12,14 +12,12 @@ abstract on('-e', '--api-endpoint URL', 'Travis API server to talk to') on('-I', '--[no-]insecure', 'do not verify SSL certificate of API endpoint') - on('--pro', "short-cut for --api-endpoint '#{Travis::Client::COM_URI}'") { |c, _| c.api_endpoint = Travis::Client::COM_URI } - on('--com', "short-cut for --api-endpoint '#{Travis::Client::COM_URI}'") { |c, _| c.api_endpoint = Travis::Client::COM_URI } - on('--org', "short-cut for --api-endpoint '#{Travis::Client::ORG_URI}'") { |c, _| c.api_endpoint = Travis::Client::ORG_URI } - on('--staging', 'talks to staging system') { |c, _| c.api_endpoint = c.api_endpoint.gsub(/api/, 'api-staging') } + on('--pro', "short-cut for --api-endpoint '#{Travis::Client::COM_URI}' [deprecated]") { |c, _| c.api_endpoint = Travis::Client::COM_URI } + on('--com', "short-cut for --api-endpoint '#{Travis::Client::COM_URI}' [deprecated]") { |c, _| c.api_endpoint = Travis::Client::COM_URI } on('-t', '--token [ACCESS_TOKEN]', 'access token to use') { |c, t| c.access_token = t } on('--debug', 'show API requests') do |c, _| c.debug = true c.session.instrument do |info, request| @@ -62,25 +60,21 @@ self.access_token ||= fetch_token endpoint_config['access_token'] ||= access_token endpoint_config['insecure'] = insecure unless insecure.nil? self.insecure = endpoint_config['insecure'] session.ssl = { verify: false } if insecure? - authenticate if pro? || enterprise? + authenticate end def enterprise? !!endpoint_config['enterprise'] end def pro? api_endpoint == Travis::Client::COM_URI end - def org? - api_endpoint == Travis::Client::ORG_URI - end - def detected_endpoint? api_endpoint == detected_endpoint end def authenticate @@ -168,11 +162,9 @@ default_endpoint || Travis::Client::COM_URI end def endpoint_option return "" if pro? and detected_endpoint? - return " --org" if org? - return " --pro" if pro? if config['enterprise'] key, _ = config['enterprise'].detect { |k,v| v.start_with? api_endpoint } return " -X" if key == "default" return " -X #{key}" if key