class Pod::Command::Trunk::Deprecate

@CocoaPods 1.0.0.beta.1

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/pod/command/trunk/deprecate.rb, line 18
def initialize(argv)
  @name = argv.shift_argument
  @in_favor_of = argv.option('in-favor-of')
  super
end
options() click to toggle source
Calls superclass method
# File lib/pod/command/trunk/deprecate.rb, line 12
def self.options
  [
    ['--in-favor-of=OTHER_NAME', 'The pod to deprecate this pod in favor of.'],
  ].concat(super)
end

Public Instance Methods

deprecate() click to toggle source
# File lib/pod/command/trunk/deprecate.rb, line 34
def deprecate
  body = {
    :in_favor_of => @in_favor_of,
  }.to_json
  response = request_path(:patch, "pods/#{@name}/deprecated", body, auth_headers)
  url = response.headers['location'].first
  json(request_url(:get, url, default_headers))
rescue REST::Error => e
  raise Informative, 'There was an error deprecating the pod ' \
                           "via trunk: #{e.message}"
end
run() click to toggle source
# File lib/pod/command/trunk/deprecate.rb, line 29
def run
  json = deprecate
  print_messages(json['data_url'], json['messages'], nil, nil)
end
validate!() click to toggle source
Calls superclass method
# File lib/pod/command/trunk/deprecate.rb, line 24
def validate!
  super
  help! 'Please specify a pod name.' unless @name
end