Class: Pod::Command::Trunk::Deprecate
Constant Summary
BASE_URL, SCHEME_AND_HOST
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(argv) ⇒ Deprecate
Returns a new instance of Deprecate.
18
19
20
21
22
|
# 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
|
Class Method Details
.options ⇒ Object
12
13
14
15
16
|
# 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
|
Instance Method Details
#deprecate ⇒ Object
34
35
36
37
38
39
40
41
42
43
44
|
# 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, )
url = response.['location'].first
json(request_url(:get, url, ))
rescue REST::Error => e
raise Informative, 'There was an error deprecating the pod ' \
"via trunk: #{e.message}"
end
|
#run ⇒ Object
29
30
31
32
|
# File 'lib/pod/command/trunk/deprecate.rb', line 29
def run
json = deprecate
print_messages(json['data_url'], json['messages'], nil, nil)
end
|
#validate! ⇒ Object
24
25
26
27
|
# File 'lib/pod/command/trunk/deprecate.rb', line 24
def validate!
super
help! 'Please specify a pod name.' unless @name
end
|