cocoapods-trunk 1.0.0.beta.1 → 1.0.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3eb4cae6ccbe9e620949aa8af58097cfa5022000
4
- data.tar.gz: e056c037de70a65beadd3ecfed9ec2ea7952a9de
3
+ metadata.gz: 1c41415e0fb060d2aeeab80a8d5feacaca2597c6
4
+ data.tar.gz: f98ea9c2582d5420292044aa1fc4f6630cd4e3b7
5
5
  SHA512:
6
- metadata.gz: b4eea927a092373d22fa7c06a602dda5ae2c1d400a44123af721fe0006e2dc3669d32986bb43da125cae32275b009e0119123e1c596b8b82b436d031df108004
7
- data.tar.gz: 023e5b4ee7b5cd4829cc9b4287eba4b01a56632a919ffe6754ec34996f8f56469c75c4230e6136996b237650172691e71c8264187ea2bd7b3ca0ecef04875704
6
+ metadata.gz: ac7dd609a4f0534c96fd7a0bdf4e8d7976b7347c7e7ca6c2c111e3188df3b42fba7b2fbd2d2948ffd3398df0d94f3b3381ceba4d97f46eef155f5ccf49452644
7
+ data.tar.gz: 57d32e37e9217cc7275fd1af902b5a74c6bf1ca1b123270ebe8ab16d2bf263fb2d6555cb571e363162410e553c020245dff4234601194f6b072c28358286aa6f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 1.0.0.beta.2 (2016-02-03)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * Send a body with the `PATCH` request to deprecate a pod.
6
+ [Samuel Giddins](https://github.com/segiddins)
7
+ [#52](https://github.com/CocoaPods/cocoapods-trunk/issues/52)
8
+
9
+
1
10
  ## 1.0.0.beta.1 (2015-12-30)
2
11
 
3
12
  ##### Enhancements
data/Gemfile.lock CHANGED
@@ -39,7 +39,7 @@ GIT
39
39
  PATH
40
40
  remote: .
41
41
  specs:
42
- cocoapods-trunk (1.0.0.beta.1)
42
+ cocoapods-trunk (1.0.0.beta.2)
43
43
  nap (>= 0.8, < 2.0)
44
44
  netrc (= 0.7.8)
45
45
 
@@ -1,3 +1,3 @@
1
1
  module CocoaPodsTrunk
2
- VERSION = '1.0.0.beta.1'.freeze
2
+ VERSION = '1.0.0.beta.2'.freeze
3
3
  end
@@ -109,7 +109,7 @@ module Pod
109
109
 
110
110
  def formatted_time(time_string)
111
111
  require 'active_support/time'
112
- @tz_offset ||= Time.zone_offset(`/bin/date +%Z`.strip)
112
+ @tz_offset ||= Time.zone_offset(time_zone)
113
113
  @current_year ||= Date.today.year
114
114
 
115
115
  time = Time.parse(time_string) + @tz_offset
@@ -120,6 +120,11 @@ module Pod
120
120
  end
121
121
  formatted
122
122
  end
123
+
124
+ def time_zone
125
+ out, = Executable.execute_command('/bin/date', %w(+%Z), :capture => :out)
126
+ out.strip
127
+ end
123
128
  end
124
129
  end
125
130
  end
@@ -30,7 +30,10 @@ module Pod
30
30
  end
31
31
 
32
32
  def deprecate
33
- response = request_path(:patch, "pods/#{@name}/deprecated", auth_headers)
33
+ body = {
34
+ :in_favor_of => @in_favor_of,
35
+ }.to_json
36
+ response = request_path(:patch, "pods/#{@name}/deprecated", body, auth_headers)
34
37
  url = response.headers['location'].first
35
38
  json(request_url(:get, url, default_headers))
36
39
  rescue REST::Error => e
@@ -14,8 +14,8 @@ module Pod
14
14
  lambda { command.validate! }.should.raise CLAide::Help
15
15
  end
16
16
 
17
- it 'should show information for a pod' do
18
- response = {
17
+ before do
18
+ @push_response = {
19
19
  'messages' => [
20
20
  {
21
21
  '2015-12-05 02:00:25 UTC' => 'Push for `Stencil 0.96.3` initiated.',
@@ -26,11 +26,33 @@ module Pod
26
26
  ],
27
27
  'data_url' => 'https://raw.githubusercontent.com/CocoaPods/Specs/ce4efe9f986d297008e8c61010a4b0d5881c50d0/Specs/Stencil/0.96.3/Stencil.podspec.json',
28
28
  }
29
- Command::Trunk::Deprecate.any_instance.expects(:deprecate).returns(response)
29
+ end
30
+
31
+ it 'should show information for a pod' do
32
+ Command::Trunk::Deprecate.any_instance.expects(:deprecate).returns(@push_response)
30
33
  Command::Trunk::Deprecate.invoke(%w(Stencil))
31
34
 
32
35
  UI.output.should.include 'Data URL: https://raw.githubusercontent'
33
36
  UI.output.should.include 'Push for `Stencil 0.96.3` initiated'
34
37
  end
38
+
39
+ it 'should send the proper network request' do
40
+ redirect = 'http://redirected.com'
41
+ WebMock::API.stub_request(:patch, 'https://trunk.cocoapods.org/api/v1/pods/Stencil/deprecated').
42
+ with(:body => WebMock::API.hash_including('in_favor_of' => 'Stamp')).
43
+ to_return(:status => 201, :headers => { :location => redirect })
44
+
45
+ WebMock::API.stub_request(:get, redirect).
46
+ to_return(:status => 200, :body => @push_response.to_json)
47
+
48
+ Command::Trunk::Deprecate.invoke(%w(Stencil --in-favor-of=Stamp))
49
+
50
+ UI.output.should == <<-EOS
51
+ - Data URL: https://raw.githubusercontent.com/CocoaPods/Specs/ce4efe9f986d297008e8c61010a4b0d5881c50d0/Specs/Stencil/0.96.3/Stencil.podspec.json
52
+ - Log messages:
53
+ - December 5th, 2015 02:00: Push for `Stencil 0.96.3` initiated.
54
+ - December 5th, 2015 02:00: Push for `Stencil 0.96.3` has been pushed (1.02409270 s).
55
+ EOS
56
+ end
35
57
  end
36
58
  end
data/spec/spec_helper.rb CHANGED
@@ -64,6 +64,12 @@ module Pod
64
64
  end
65
65
  end
66
66
  end
67
+
68
+ class Command::Trunk
69
+ def time_zone
70
+ 'UTC'
71
+ end
72
+ end
67
73
  end
68
74
 
69
75
  module Bacon
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-trunk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta.1
4
+ version: 1.0.0.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Durán
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-30 00:00:00.000000000 Z
11
+ date: 2016-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nap
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: 1.3.1
135
135
  requirements: []
136
136
  rubyforge_project:
137
- rubygems_version: 2.5.1
137
+ rubygems_version: 2.5.2
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: Interact with trunk.cocoapods.org