cocoapods-trunk 0.6.4 → 1.0.0.beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/Gemfile.lock +25 -24
- data/lib/cocoapods_trunk.rb +1 -1
- data/lib/pod/command/trunk.rb +18 -4
- data/lib/pod/command/trunk/delete.rb +68 -0
- data/lib/pod/command/trunk/deprecate.rb +43 -0
- data/lib/pod/command/trunk/push.rb +14 -15
- data/spec/command/trunk/delete_spec.rb +70 -0
- data/spec/command/trunk/deprecate_spec.rb +36 -0
- data/spec/command/trunk/push_spec.rb +39 -0
- data/spec/spec_helper.rb +20 -6
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eb4cae6ccbe9e620949aa8af58097cfa5022000
|
4
|
+
data.tar.gz: e056c037de70a65beadd3ecfed9ec2ea7952a9de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4eea927a092373d22fa7c06a602dda5ae2c1d400a44123af721fe0006e2dc3669d32986bb43da125cae32275b009e0119123e1c596b8b82b436d031df108004
|
7
|
+
data.tar.gz: 023e5b4ee7b5cd4829cc9b4287eba4b01a56632a919ffe6754ec34996f8f56469c75c4230e6136996b237650172691e71c8264187ea2bd7b3ca0ecef04875704
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
## 1.0.0.beta.1 (2015-12-30)
|
2
|
+
|
3
|
+
##### Enhancements
|
4
|
+
|
5
|
+
* The `pod deprecate PODNAME` command has been added to deprecate all versions
|
6
|
+
of a pod.
|
7
|
+
[Samuel Giddins](https://github.com/segiddins)
|
8
|
+
[#31](https://github.com/CocoaPods/cocoapods-trunk/issues/31)
|
9
|
+
|
10
|
+
* The `pod delete PODNAME VERSION` command has been added to delete a single
|
11
|
+
version of a pod.
|
12
|
+
[Samuel Giddins](https://github.com/segiddins)
|
13
|
+
|
14
|
+
##### Bug Fixes
|
15
|
+
|
16
|
+
* If the master repo has not been setup when pushing a spec, run `pod setup`
|
17
|
+
instead of failing.
|
18
|
+
[Samuel Giddins](https://github.com/segiddins)
|
19
|
+
[#48](https://github.com/CocoaPods/cocoapods-trunk/issues/48)
|
20
|
+
|
21
|
+
|
1
22
|
## 0.6.4 (2015-08-28)
|
2
23
|
|
3
24
|
##### Bug Fixes
|
data/Gemfile.lock
CHANGED
@@ -1,44 +1,45 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/CocoaPods/CLAide.git
|
3
|
-
revision:
|
3
|
+
revision: b44534d04023fbe82182a8be33d5c728f74c1b9c
|
4
4
|
branch: master
|
5
5
|
specs:
|
6
6
|
claide (0.9.1)
|
7
7
|
|
8
8
|
GIT
|
9
9
|
remote: https://github.com/CocoaPods/CocoaPods.git
|
10
|
-
revision:
|
10
|
+
revision: b34c7148a3952195f1eddb684d7eae2a941eb431
|
11
11
|
branch: master
|
12
12
|
specs:
|
13
|
-
cocoapods (0.
|
14
|
-
activesupport (>=
|
13
|
+
cocoapods (0.39.0)
|
14
|
+
activesupport (>= 4.0.2)
|
15
15
|
claide (~> 0.9.1)
|
16
|
-
cocoapods-core (= 0.
|
17
|
-
cocoapods-downloader (~> 0.9.
|
16
|
+
cocoapods-core (= 0.39.0)
|
17
|
+
cocoapods-downloader (~> 0.9.3)
|
18
18
|
cocoapods-plugins (~> 0.4.2)
|
19
|
-
cocoapods-
|
20
|
-
cocoapods-
|
21
|
-
cocoapods-
|
19
|
+
cocoapods-search (~> 0.1.0)
|
20
|
+
cocoapods-stats (~> 0.6.2)
|
21
|
+
cocoapods-trunk (~> 1.0.0.beta.1)
|
22
|
+
cocoapods-try (~> 0.5.1)
|
22
23
|
colored (~> 1.2)
|
23
24
|
escape (~> 0.0.4)
|
24
|
-
molinillo (~> 0.
|
25
|
+
molinillo (~> 0.4.0)
|
25
26
|
nap (~> 1.0)
|
26
|
-
xcodeproj (~> 0.
|
27
|
+
xcodeproj (~> 0.28.2)
|
27
28
|
|
28
29
|
GIT
|
29
30
|
remote: https://github.com/CocoaPods/Core.git
|
30
|
-
revision:
|
31
|
+
revision: c91e84a264ce9ab5fc500cc8bd8ffad9c9ecd3cf
|
31
32
|
branch: master
|
32
33
|
specs:
|
33
|
-
cocoapods-core (0.
|
34
|
-
activesupport (>=
|
34
|
+
cocoapods-core (0.39.0)
|
35
|
+
activesupport (>= 4.0.2)
|
35
36
|
fuzzy_match (~> 2.0.4)
|
36
|
-
nap (~> 1.0
|
37
|
+
nap (~> 1.0)
|
37
38
|
|
38
39
|
PATH
|
39
40
|
remote: .
|
40
41
|
specs:
|
41
|
-
cocoapods-trunk (0.
|
42
|
+
cocoapods-trunk (1.0.0.beta.1)
|
42
43
|
nap (>= 0.8, < 2.0)
|
43
44
|
netrc (= 0.7.8)
|
44
45
|
|
@@ -56,12 +57,12 @@ GEM
|
|
56
57
|
astrolabe (1.3.1)
|
57
58
|
parser (~> 2.2)
|
58
59
|
bacon (1.2.0)
|
59
|
-
cocoapods-downloader (0.9.
|
60
|
+
cocoapods-downloader (0.9.3)
|
60
61
|
cocoapods-plugins (0.4.2)
|
61
62
|
nap
|
62
|
-
cocoapods-
|
63
|
-
|
64
|
-
cocoapods-try (0.
|
63
|
+
cocoapods-search (0.1.0)
|
64
|
+
cocoapods-stats (0.6.2)
|
65
|
+
cocoapods-try (0.5.1)
|
65
66
|
codeclimate-test-reporter (0.4.7)
|
66
67
|
simplecov (>= 0.7.1, < 1.0.0)
|
67
68
|
colored (1.2)
|
@@ -81,12 +82,12 @@ GEM
|
|
81
82
|
rb-inotify (>= 0.9)
|
82
83
|
rb-kqueue (>= 0.2)
|
83
84
|
metaclass (0.0.4)
|
84
|
-
minitest (5.8.
|
85
|
+
minitest (5.8.1)
|
85
86
|
mocha (1.1.0)
|
86
87
|
metaclass (~> 0.0.1)
|
87
88
|
mocha-on-bacon (0.2.2)
|
88
89
|
mocha (>= 0.13.0)
|
89
|
-
molinillo (0.
|
90
|
+
molinillo (0.4.0)
|
90
91
|
multi_json (1.11.2)
|
91
92
|
nap (1.0.0)
|
92
93
|
netrc (0.7.8)
|
@@ -122,7 +123,7 @@ GEM
|
|
122
123
|
webmock (1.21.0)
|
123
124
|
addressable (>= 2.3.6)
|
124
125
|
crack (>= 0.3.2)
|
125
|
-
xcodeproj (0.
|
126
|
+
xcodeproj (0.28.2)
|
126
127
|
activesupport (>= 3)
|
127
128
|
claide (~> 0.9.1)
|
128
129
|
colored (~> 1.2)
|
@@ -148,4 +149,4 @@ DEPENDENCIES
|
|
148
149
|
webmock
|
149
150
|
|
150
151
|
BUNDLED WITH
|
151
|
-
1.
|
152
|
+
1.11.2
|
data/lib/cocoapods_trunk.rb
CHANGED
data/lib/pod/command/trunk.rb
CHANGED
@@ -13,12 +13,14 @@ module Pod
|
|
13
13
|
SCHEME_AND_HOST = ENV['TRUNK_SCHEME_AND_HOST'] || 'https://trunk.cocoapods.org'
|
14
14
|
BASE_URL = "#{SCHEME_AND_HOST}/api/v1"
|
15
15
|
|
16
|
-
require 'pod/command/trunk/register'
|
17
|
-
require 'pod/command/trunk/me'
|
18
16
|
require 'pod/command/trunk/add_owner'
|
19
|
-
require 'pod/command/trunk/
|
20
|
-
require 'pod/command/trunk/
|
17
|
+
require 'pod/command/trunk/delete'
|
18
|
+
require 'pod/command/trunk/deprecate'
|
21
19
|
require 'pod/command/trunk/info'
|
20
|
+
require 'pod/command/trunk/me'
|
21
|
+
require 'pod/command/trunk/push'
|
22
|
+
require 'pod/command/trunk/register'
|
23
|
+
require 'pod/command/trunk/remove_owner'
|
22
24
|
|
23
25
|
private
|
24
26
|
|
@@ -68,6 +70,18 @@ module Pod
|
|
68
70
|
raise Informative, error
|
69
71
|
end
|
70
72
|
|
73
|
+
def print_messages(data_url, messages)
|
74
|
+
# Using UI.labeled here is dangerous, as it wraps the URL and indents
|
75
|
+
# it, which breaks the URL when you try to copy-paste it.
|
76
|
+
UI.puts " - Data URL: #{data_url}"
|
77
|
+
|
78
|
+
messages = messages.map do |entry|
|
79
|
+
at, message = entry.to_a.flatten
|
80
|
+
"#{formatted_time(at)}: #{message}"
|
81
|
+
end
|
82
|
+
UI.labeled 'Log messages', messages
|
83
|
+
end
|
84
|
+
|
71
85
|
def json(response)
|
72
86
|
JSON.parse(response.body)
|
73
87
|
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
class Trunk
|
4
|
+
class Delete < Trunk
|
5
|
+
self.summary = 'Deletes a version of a pod.'
|
6
|
+
self.description = <<-DESC
|
7
|
+
WARNING: It is generally considered bad behavior to remove
|
8
|
+
versions of a Pod that others are depending on! Please
|
9
|
+
consider using the deprecate command instead.
|
10
|
+
|
11
|
+
Deletes the specified pod version from trunk and the master specs
|
12
|
+
repo. Once deleted, this version can never be pushed again.
|
13
|
+
DESC
|
14
|
+
|
15
|
+
self.arguments = [
|
16
|
+
CLAide::Argument.new('NAME', true),
|
17
|
+
CLAide::Argument.new('VERSION', true),
|
18
|
+
]
|
19
|
+
|
20
|
+
def initialize(argv)
|
21
|
+
@name = argv.shift_argument
|
22
|
+
@version = argv.shift_argument
|
23
|
+
super
|
24
|
+
end
|
25
|
+
|
26
|
+
def validate!
|
27
|
+
super
|
28
|
+
help! 'Please specify a pod name.' unless @name
|
29
|
+
help! 'Please specify a version.' unless @version
|
30
|
+
end
|
31
|
+
|
32
|
+
def run
|
33
|
+
return unless confirm_deletion?
|
34
|
+
json = delete
|
35
|
+
print_messages(json['data_url'], json['messages'])
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
WARNING_MESSAGE = 'WARNING: It is generally considered bad behavior ' \
|
41
|
+
"to remove versions of a Pod that others are depending on!\n" \
|
42
|
+
'Please consider using the `deprecate` command instead.'.freeze
|
43
|
+
|
44
|
+
def confirm_deletion?
|
45
|
+
UI.puts(WARNING_MESSAGE.yellow)
|
46
|
+
loop do
|
47
|
+
UI.print("Are you sure you want to delete this Pod version?\n> ")
|
48
|
+
answer = UI.gets.strip.downcase
|
49
|
+
UI.puts # ensures a newline is printed after the user input
|
50
|
+
affirmatives = %w(y yes true 1)
|
51
|
+
negatives = %w(n no false 0)
|
52
|
+
return true if affirmatives.include?(answer)
|
53
|
+
return false if negatives.include?(answer)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def delete
|
58
|
+
response = request_path(:delete, "pods/#{@name}/#{@version}", auth_headers)
|
59
|
+
url = response.headers['location'].first
|
60
|
+
json(request_url(:get, url, default_headers))
|
61
|
+
rescue REST::Error => e
|
62
|
+
raise Informative, 'There was an error deleting the pod version ' \
|
63
|
+
"from trunk: #{e.message}"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
class Trunk
|
4
|
+
class Deprecate < Trunk
|
5
|
+
self.summary = 'Deprecates a pod.'
|
6
|
+
self.arguments = [
|
7
|
+
CLAide::Argument.new('NAME', true),
|
8
|
+
]
|
9
|
+
|
10
|
+
def options
|
11
|
+
[
|
12
|
+
['--in-favor-of=OTHER_NAME', 'The pod to deprecate this pod in favor of.'],
|
13
|
+
].concat(super)
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(argv)
|
17
|
+
@name = argv.shift_argument
|
18
|
+
@in_favor_of = argv.option('in-favor-of')
|
19
|
+
super
|
20
|
+
end
|
21
|
+
|
22
|
+
def validate!
|
23
|
+
super
|
24
|
+
help! 'Please specify a pod name.' unless @name
|
25
|
+
end
|
26
|
+
|
27
|
+
def run
|
28
|
+
json = deprecate
|
29
|
+
print_messages(json['data_url'], json['messages'])
|
30
|
+
end
|
31
|
+
|
32
|
+
def deprecate
|
33
|
+
response = request_path(:patch, "pods/#{@name}/deprecated", auth_headers)
|
34
|
+
url = response.headers['location'].first
|
35
|
+
json(request_url(:get, url, default_headers))
|
36
|
+
rescue REST::Error => e
|
37
|
+
raise Informative, 'There was an error deprecating the pod ' \
|
38
|
+
"via trunk: #{e.message}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -57,28 +57,23 @@ module Pod
|
|
57
57
|
def run
|
58
58
|
update_master_repo
|
59
59
|
validate_podspec
|
60
|
-
|
61
|
-
spec.to_json, auth_headers)
|
62
|
-
url = response.headers['location'].first
|
63
|
-
json = json(request_url(:get, url, default_headers))
|
60
|
+
json = push_to_trunk
|
64
61
|
update_master_repo
|
62
|
+
print_messages(json['data_url'], json['messages'])
|
63
|
+
end
|
65
64
|
|
66
|
-
|
67
|
-
# it, which breaks the URL when you try to copy-paste it.
|
68
|
-
UI.puts " - Data URL: #{json['data_url']}"
|
65
|
+
private
|
69
66
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
67
|
+
def push_to_trunk
|
68
|
+
response = request_path(:post, "pods?allow_warnings=#{@allow_warnings}",
|
69
|
+
spec.to_json, auth_headers)
|
70
|
+
url = response.headers['location'].first
|
71
|
+
json(request_url(:get, url, default_headers))
|
75
72
|
rescue REST::Error => e
|
76
73
|
raise Informative, 'There was an error pushing a new version ' \
|
77
74
|
"to trunk: #{e.message}"
|
78
75
|
end
|
79
76
|
|
80
|
-
private
|
81
|
-
|
82
77
|
def find_podspec_file
|
83
78
|
podspecs = Dir[Pathname(@path) + '*.podspec{.json,}']
|
84
79
|
case podspecs.count
|
@@ -116,7 +111,11 @@ module Pod
|
|
116
111
|
end
|
117
112
|
|
118
113
|
def update_master_repo
|
119
|
-
SourcesManager.
|
114
|
+
if SourcesManager.master_repo_functional?
|
115
|
+
SourcesManager.update('master')
|
116
|
+
else
|
117
|
+
Setup.invoke
|
118
|
+
end
|
120
119
|
end
|
121
120
|
end
|
122
121
|
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require 'tmpdir'
|
3
|
+
|
4
|
+
module Pod
|
5
|
+
describe Command::Trunk::Delete do
|
6
|
+
describe 'CLAide' do
|
7
|
+
it 'registers it self' do
|
8
|
+
Command.parse(%w( trunk delete )).should.be.instance_of Command::Trunk::Delete
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should error without a pod name' do
|
13
|
+
command = Command.parse(%w( trunk delete ))
|
14
|
+
lambda { command.validate! }.should.raise CLAide::Help
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should error without a version' do
|
18
|
+
command = Command.parse(%w( trunk delete Stencil ))
|
19
|
+
lambda { command.validate! }.should.raise CLAide::Help
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'confirms deletion' do
|
23
|
+
UI.inputs += %w(garbage true false)
|
24
|
+
command = Command.parse(%w( trunk delete Stencil 1.0.0 ))
|
25
|
+
command.send(:confirm_deletion?).should.be.true
|
26
|
+
command.send(:confirm_deletion?).should.be.false
|
27
|
+
|
28
|
+
# rubocop:disable Metrics/LineLength
|
29
|
+
UI.output.should == <<-OUTPUT.gsub(/^>$/, '> ')
|
30
|
+
\e[33mWARNING: It is generally considered bad behavior to remove versions of a Pod that others are depending on!
|
31
|
+
Please consider using the `deprecate` command instead.\e[0m
|
32
|
+
Are you sure you want to delete this Pod version?
|
33
|
+
>
|
34
|
+
Are you sure you want to delete this Pod version?
|
35
|
+
>
|
36
|
+
\e[33mWARNING: It is generally considered bad behavior to remove versions of a Pod that others are depending on!
|
37
|
+
Please consider using the `deprecate` command instead.\e[0m
|
38
|
+
Are you sure you want to delete this Pod version?
|
39
|
+
>
|
40
|
+
OUTPUT
|
41
|
+
# rubocop:enable Metrics/LineLength
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'does not delete if the user does not confirm' do
|
45
|
+
Command::Trunk::Delete.any_instance.expects(:confirm_deletion?).returns(false)
|
46
|
+
Command::Trunk::Delete.any_instance.expects(:delete).never
|
47
|
+
Command::Trunk::Delete.invoke(%w(Stencil 1.0.0))
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'should show information for a pod' do
|
51
|
+
response = {
|
52
|
+
'messages' => [
|
53
|
+
{
|
54
|
+
'2015-12-05 02:00:25 UTC' => 'Push for `Stencil 1.0.0` initiated.',
|
55
|
+
},
|
56
|
+
{
|
57
|
+
'2015-12-05 02:00:26 UTC' => 'Push for `Stencil 1.0.0` has been pushed (1.02409270 s).',
|
58
|
+
},
|
59
|
+
],
|
60
|
+
'data_url' => 'https://raw.githubusercontent.com/CocoaPods/Specs/ce4efe9f986d297008e8c61010a4b0d5881c50d0/Specs/Stencil/1.0.0/Stencil.podspec.json',
|
61
|
+
}
|
62
|
+
Command::Trunk::Delete.any_instance.expects(:delete).returns(response)
|
63
|
+
UI.inputs << 'TRUE '
|
64
|
+
Command::Trunk::Delete.invoke(%w(Stencil 1.0.0))
|
65
|
+
|
66
|
+
UI.output.should.include 'Data URL: https://raw.githubusercontent'
|
67
|
+
UI.output.should.include 'Push for `Stencil 1.0.0` initiated'
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require 'tmpdir'
|
3
|
+
|
4
|
+
module Pod
|
5
|
+
describe Command::Trunk::Deprecate do
|
6
|
+
describe 'CLAide' do
|
7
|
+
it 'registers it self' do
|
8
|
+
Command.parse(%w( trunk deprecate )).should.be.instance_of Command::Trunk::Deprecate
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should error without a pod name' do
|
13
|
+
command = Command.parse(%w( trunk deprecate ))
|
14
|
+
lambda { command.validate! }.should.raise CLAide::Help
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should show information for a pod' do
|
18
|
+
response = {
|
19
|
+
'messages' => [
|
20
|
+
{
|
21
|
+
'2015-12-05 02:00:25 UTC' => 'Push for `Stencil 0.96.3` initiated.',
|
22
|
+
},
|
23
|
+
{
|
24
|
+
'2015-12-05 02:00:26 UTC' => 'Push for `Stencil 0.96.3` has been pushed (1.02409270 s).',
|
25
|
+
},
|
26
|
+
],
|
27
|
+
'data_url' => 'https://raw.githubusercontent.com/CocoaPods/Specs/ce4efe9f986d297008e8c61010a4b0d5881c50d0/Specs/Stencil/0.96.3/Stencil.podspec.json',
|
28
|
+
}
|
29
|
+
Command::Trunk::Deprecate.any_instance.expects(:deprecate).returns(response)
|
30
|
+
Command::Trunk::Deprecate.invoke(%w(Stencil))
|
31
|
+
|
32
|
+
UI.output.should.include 'Data URL: https://raw.githubusercontent'
|
33
|
+
UI.output.should.include 'Push for `Stencil 0.96.3` initiated'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -104,6 +104,8 @@ module Pod
|
|
104
104
|
with(:ios, nil, true).once.returns(Podfile.new)
|
105
105
|
Validator.any_instance.expects(:podfile_from_spec).
|
106
106
|
with(:osx, nil, true).once.returns(Podfile.new)
|
107
|
+
Validator.any_instance.expects(:podfile_from_spec).
|
108
|
+
with(:tvos, nil, true).once.returns(Podfile.new)
|
107
109
|
Validator.any_instance.expects(:podfile_from_spec).
|
108
110
|
with(:watchos, nil, true).once.returns(Podfile.new)
|
109
111
|
|
@@ -116,6 +118,8 @@ module Pod
|
|
116
118
|
with(:ios, nil, false).once.returns(Podfile.new)
|
117
119
|
Validator.any_instance.expects(:podfile_from_spec).
|
118
120
|
with(:osx, nil, false).once.returns(Podfile.new)
|
121
|
+
Validator.any_instance.expects(:podfile_from_spec).
|
122
|
+
with(:tvos, nil, false).once.returns(Podfile.new)
|
119
123
|
Validator.any_instance.expects(:podfile_from_spec).
|
120
124
|
with(:watchos, nil, false).once.returns(Podfile.new)
|
121
125
|
|
@@ -123,5 +127,40 @@ module Pod
|
|
123
127
|
cmd.send(:validate_podspec)
|
124
128
|
end
|
125
129
|
end
|
130
|
+
|
131
|
+
describe 'updating the master repo' do
|
132
|
+
before do
|
133
|
+
@cmd = Command.parse(%w(trunk push spec/fixtures/BananaLib.podspec))
|
134
|
+
@cmd.stubs(:validate_podspec)
|
135
|
+
version_response = {
|
136
|
+
'messages' => [
|
137
|
+
{
|
138
|
+
'2015-12-05 02:00:25 UTC' => "Push for `BananaLib 0.96.3' initiated.",
|
139
|
+
},
|
140
|
+
{
|
141
|
+
'2015-12-05 02:00:26 UTC' => "Push for `BananaLib 0.96.3' has been pushed (1.02409270 s).",
|
142
|
+
},
|
143
|
+
],
|
144
|
+
'data_url' => 'https://raw.githubusercontent.com/CocoaPods/Specs/ce4efe9f986d297008e8c61010a4b0d5881c50d0/Specs/BananaLib/0.96.3/BananaLib.podspec.json',
|
145
|
+
}
|
146
|
+
@cmd.stubs(:push_to_trunk).returns(version_response)
|
147
|
+
Command::Trunk::Push.any_instance.unstub(:update_master_repo)
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'updates the master repo when it exists' do
|
151
|
+
SourcesManager.stubs(:master_repo_functional?).returns(true)
|
152
|
+
SourcesManager.expects(:update).with('master').twice
|
153
|
+
|
154
|
+
@cmd.run
|
155
|
+
end
|
156
|
+
|
157
|
+
it 'sets up the master repo when it does not exist' do
|
158
|
+
SourcesManager.stubs(:master_repo_functional?).returns(false)
|
159
|
+
SourcesManager.expects(:update).never
|
160
|
+
Command::Setup.any_instance.expects(:run).twice
|
161
|
+
|
162
|
+
@cmd.run
|
163
|
+
end
|
164
|
+
end
|
126
165
|
end
|
127
166
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -45,6 +45,11 @@ module Pod
|
|
45
45
|
class << self
|
46
46
|
attr_accessor :output
|
47
47
|
attr_accessor :warnings
|
48
|
+
attr_accessor :inputs
|
49
|
+
|
50
|
+
def gets
|
51
|
+
inputs.shift
|
52
|
+
end
|
48
53
|
|
49
54
|
def puts(message = '')
|
50
55
|
@output << "#{message}\n"
|
@@ -63,12 +68,21 @@ end
|
|
63
68
|
|
64
69
|
module Bacon
|
65
70
|
class Context
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
71
|
+
old_run_requirement = instance_method(:run_requirement)
|
72
|
+
define_method(:run_requirement) do |description, spec|
|
73
|
+
::Pod::Config.instance = nil
|
74
|
+
::Pod::UI.output = ''
|
75
|
+
::Pod::UI.warnings = ''
|
76
|
+
::Pod::UI.inputs = []
|
77
|
+
# The following prevents a nasty behaviour where the increments are not
|
78
|
+
# balanced when testing informative which might lead to sections not
|
79
|
+
# being printed to the output as they are too nested.
|
80
|
+
::Pod::UI.indentation_level = 0
|
81
|
+
::Pod::UI.title_level = 0
|
82
|
+
|
83
|
+
WebMock.reset!
|
84
|
+
|
85
|
+
old_run_requirement.bind(self).call(description, spec)
|
72
86
|
end
|
73
87
|
end
|
74
88
|
end
|
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: 0.
|
4
|
+
version: 1.0.0.beta.1
|
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-
|
11
|
+
date: 2015-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nap
|
@@ -96,12 +96,16 @@ files:
|
|
96
96
|
- lib/cocoapods_trunk.rb
|
97
97
|
- lib/pod/command/trunk.rb
|
98
98
|
- lib/pod/command/trunk/add_owner.rb
|
99
|
+
- lib/pod/command/trunk/delete.rb
|
100
|
+
- lib/pod/command/trunk/deprecate.rb
|
99
101
|
- lib/pod/command/trunk/info.rb
|
100
102
|
- lib/pod/command/trunk/me.rb
|
101
103
|
- lib/pod/command/trunk/push.rb
|
102
104
|
- lib/pod/command/trunk/register.rb
|
103
105
|
- lib/pod/command/trunk/remove_owner.rb
|
104
106
|
- spec/command/trunk/addowner_spec.rb
|
107
|
+
- spec/command/trunk/delete_spec.rb
|
108
|
+
- spec/command/trunk/deprecate_spec.rb
|
105
109
|
- spec/command/trunk/info_spec.rb
|
106
110
|
- spec/command/trunk/me_spec.rb
|
107
111
|
- spec/command/trunk/push_spec.rb
|
@@ -125,17 +129,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
125
129
|
version: 2.0.0
|
126
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
131
|
requirements:
|
128
|
-
- - '
|
132
|
+
- - '>'
|
129
133
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
134
|
+
version: 1.3.1
|
131
135
|
requirements: []
|
132
136
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.
|
137
|
+
rubygems_version: 2.5.1
|
134
138
|
signing_key:
|
135
139
|
specification_version: 4
|
136
140
|
summary: Interact with trunk.cocoapods.org
|
137
141
|
test_files:
|
138
142
|
- spec/command/trunk/addowner_spec.rb
|
143
|
+
- spec/command/trunk/delete_spec.rb
|
144
|
+
- spec/command/trunk/deprecate_spec.rb
|
139
145
|
- spec/command/trunk/info_spec.rb
|
140
146
|
- spec/command/trunk/me_spec.rb
|
141
147
|
- spec/command/trunk/push_spec.rb
|