cocoapods-trunk 0.6.0 → 1.4.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 +5 -5
- data/.rubocop_cocoapods.yml +29 -2
- data/.travis.yml +16 -15
- data/CHANGELOG.md +258 -9
- data/Gemfile +3 -1
- data/Gemfile.lock +103 -70
- data/README.md +1 -1
- data/cocoapods-trunk.gemspec +4 -4
- data/lib/cocoapods_trunk.rb +1 -1
- data/lib/pod/command/trunk/add_owner.rb +4 -1
- data/lib/pod/command/trunk/delete.rb +70 -0
- data/lib/pod/command/trunk/deprecate.rb +48 -0
- data/lib/pod/command/trunk/info.rb +2 -0
- data/lib/pod/command/trunk/me.rb +2 -0
- data/lib/pod/command/trunk/push.rb +73 -21
- data/lib/pod/command/trunk/register.rb +10 -7
- data/lib/pod/command/trunk/remove_owner.rb +4 -1
- data/lib/pod/command/trunk.rb +44 -9
- data/spec/command/trunk/addowner_spec.rb +2 -2
- data/spec/command/trunk/delete_spec.rb +68 -0
- data/spec/command/trunk/deprecate_spec.rb +58 -0
- data/spec/command/trunk/info_spec.rb +1 -1
- data/spec/command/trunk/me_spec.rb +2 -2
- data/spec/command/trunk/push_spec.rb +193 -9
- data/spec/command/trunk/register_spec.rb +2 -2
- data/spec/command/trunk/remove_owner_spec.rb +1 -1
- data/spec/command/trunk_spec.rb +1 -1
- data/spec/spec_helper.rb +30 -7
- metadata +36 -25
data/Gemfile.lock
CHANGED
|
@@ -1,76 +1,101 @@
|
|
|
1
1
|
GIT
|
|
2
2
|
remote: https://github.com/CocoaPods/CLAide.git
|
|
3
|
-
revision:
|
|
3
|
+
revision: b5ced9cc141df732e8027078543eb92fc6447567
|
|
4
4
|
branch: master
|
|
5
5
|
specs:
|
|
6
|
-
claide (0.
|
|
6
|
+
claide (1.0.3)
|
|
7
7
|
|
|
8
8
|
GIT
|
|
9
9
|
remote: https://github.com/CocoaPods/CocoaPods.git
|
|
10
|
-
revision:
|
|
10
|
+
revision: af83e4713771bc98dd7f903cc81c4fbc8866812c
|
|
11
11
|
branch: master
|
|
12
12
|
specs:
|
|
13
|
-
cocoapods (
|
|
14
|
-
activesupport (>=
|
|
15
|
-
claide (
|
|
16
|
-
cocoapods-core (=
|
|
17
|
-
cocoapods-
|
|
18
|
-
cocoapods-
|
|
19
|
-
cocoapods-
|
|
20
|
-
cocoapods-
|
|
21
|
-
|
|
13
|
+
cocoapods (1.8.0.beta.1)
|
|
14
|
+
activesupport (>= 4.0.2, < 5)
|
|
15
|
+
claide (>= 1.0.2, < 2.0)
|
|
16
|
+
cocoapods-core (= 1.8.0.beta.1)
|
|
17
|
+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
|
18
|
+
cocoapods-downloader (>= 1.2.2, < 2.0)
|
|
19
|
+
cocoapods-plugins (>= 1.0.0, < 2.0)
|
|
20
|
+
cocoapods-search (>= 1.0.0, < 2.0)
|
|
21
|
+
cocoapods-stats (>= 1.0.0, < 2.0)
|
|
22
|
+
cocoapods-trunk (= 1.4.1)
|
|
23
|
+
cocoapods-try (>= 1.1.0, < 2.0)
|
|
24
|
+
colored2 (~> 3.1)
|
|
22
25
|
escape (~> 0.0.4)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
fourflusher (>= 2.3.0, < 3.0)
|
|
27
|
+
gh_inspector (~> 1.0)
|
|
28
|
+
molinillo (~> 0.6.6)
|
|
29
|
+
nap (~> 1.0)
|
|
30
|
+
ruby-macho (~> 1.4)
|
|
31
|
+
xcodeproj (>= 1.11.1, < 2.0)
|
|
27
32
|
|
|
28
33
|
GIT
|
|
29
34
|
remote: https://github.com/CocoaPods/Core.git
|
|
30
|
-
revision:
|
|
35
|
+
revision: 0a6dea961da236995dfde3c7927e4daaf2045820
|
|
31
36
|
branch: master
|
|
32
37
|
specs:
|
|
33
|
-
cocoapods-core (
|
|
34
|
-
activesupport (>=
|
|
38
|
+
cocoapods-core (1.8.0.beta.1)
|
|
39
|
+
activesupport (>= 4.0.2, < 6)
|
|
40
|
+
algoliasearch (~> 1.0)
|
|
41
|
+
concurrent-ruby (~> 1.0)
|
|
35
42
|
fuzzy_match (~> 2.0.4)
|
|
36
|
-
nap (~>
|
|
43
|
+
nap (~> 1.0)
|
|
44
|
+
|
|
45
|
+
GIT
|
|
46
|
+
remote: https://github.com/segiddins/json.git
|
|
47
|
+
revision: a9588bc4334c2f5bf985f255b61c05eafdcd8907
|
|
48
|
+
branch: seg-1.7.7-ruby-2.2
|
|
49
|
+
specs:
|
|
50
|
+
json (1.7.7)
|
|
37
51
|
|
|
38
52
|
PATH
|
|
39
53
|
remote: .
|
|
40
54
|
specs:
|
|
41
|
-
cocoapods-trunk (
|
|
42
|
-
nap (>= 0.8)
|
|
43
|
-
netrc (
|
|
55
|
+
cocoapods-trunk (1.4.1)
|
|
56
|
+
nap (>= 0.8, < 2.0)
|
|
57
|
+
netrc (~> 0.11)
|
|
44
58
|
|
|
45
59
|
GEM
|
|
46
60
|
remote: https://rubygems.org/
|
|
47
61
|
specs:
|
|
48
|
-
|
|
62
|
+
CFPropertyList (3.0.0)
|
|
63
|
+
activesupport (4.2.11.1)
|
|
49
64
|
i18n (~> 0.7)
|
|
50
|
-
json (~> 1.7, >= 1.7.7)
|
|
51
65
|
minitest (~> 5.1)
|
|
52
66
|
thread_safe (~> 0.3, >= 0.3.4)
|
|
53
67
|
tzinfo (~> 1.1)
|
|
54
|
-
addressable (2.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
68
|
+
addressable (2.5.1)
|
|
69
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
|
70
|
+
algoliasearch (1.26.1)
|
|
71
|
+
httpclient (~> 2.8, >= 2.8.3)
|
|
72
|
+
json (>= 1.5.1)
|
|
73
|
+
ast (2.2.0)
|
|
74
|
+
atomos (0.1.3)
|
|
58
75
|
bacon (1.2.0)
|
|
59
|
-
cocoapods-
|
|
60
|
-
cocoapods-
|
|
76
|
+
cocoapods-deintegrate (1.0.4)
|
|
77
|
+
cocoapods-downloader (1.2.2)
|
|
78
|
+
cocoapods-plugins (1.0.0)
|
|
61
79
|
nap
|
|
62
|
-
cocoapods-
|
|
63
|
-
|
|
80
|
+
cocoapods-search (1.0.0)
|
|
81
|
+
cocoapods-stats (1.1.0)
|
|
82
|
+
cocoapods-try (1.1.0)
|
|
83
|
+
codeclimate-test-reporter (0.4.7)
|
|
64
84
|
simplecov (>= 0.7.1, < 1.0.0)
|
|
65
|
-
|
|
66
|
-
|
|
85
|
+
colored2 (3.1.2)
|
|
86
|
+
concurrent-ruby (1.1.5)
|
|
87
|
+
crack (0.4.3)
|
|
67
88
|
safe_yaml (~> 1.0.0)
|
|
68
89
|
docile (1.1.5)
|
|
69
90
|
escape (0.0.4)
|
|
70
|
-
ffi (1.9.
|
|
91
|
+
ffi (1.9.10)
|
|
92
|
+
fourflusher (2.3.1)
|
|
71
93
|
fuzzy_match (2.0.4)
|
|
72
|
-
|
|
73
|
-
|
|
94
|
+
gh_inspector (1.1.3)
|
|
95
|
+
hashdiff (0.3.4)
|
|
96
|
+
httpclient (2.8.3)
|
|
97
|
+
i18n (0.9.5)
|
|
98
|
+
concurrent-ruby (~> 1.0)
|
|
74
99
|
kicker (3.0.0)
|
|
75
100
|
listen (~> 1.3.0)
|
|
76
101
|
notify (~> 0.5.2)
|
|
@@ -79,53 +104,58 @@ GEM
|
|
|
79
104
|
rb-inotify (>= 0.9)
|
|
80
105
|
rb-kqueue (>= 0.2)
|
|
81
106
|
metaclass (0.0.4)
|
|
82
|
-
minitest (5.
|
|
107
|
+
minitest (5.11.3)
|
|
83
108
|
mocha (1.1.0)
|
|
84
109
|
metaclass (~> 0.0.1)
|
|
85
110
|
mocha-on-bacon (0.2.2)
|
|
86
111
|
mocha (>= 0.13.0)
|
|
87
|
-
molinillo (0.
|
|
88
|
-
multi_json (1.
|
|
89
|
-
|
|
90
|
-
|
|
112
|
+
molinillo (0.6.6)
|
|
113
|
+
multi_json (1.11.2)
|
|
114
|
+
nanaimo (0.2.6)
|
|
115
|
+
nap (1.1.0)
|
|
116
|
+
netrc (0.11.0)
|
|
91
117
|
notify (0.5.2)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
slop (~> 3.4, >= 3.4.5)
|
|
96
|
-
powerpack (0.0.9)
|
|
118
|
+
parser (2.3.0.7)
|
|
119
|
+
ast (~> 2.2)
|
|
120
|
+
powerpack (0.1.1)
|
|
97
121
|
prettybacon (0.0.2)
|
|
98
122
|
bacon (~> 1.2)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
123
|
+
public_suffix (2.0.5)
|
|
124
|
+
rainbow (2.1.0)
|
|
125
|
+
rake (10.4.2)
|
|
126
|
+
rb-fsevent (0.9.5)
|
|
102
127
|
rb-inotify (0.9.5)
|
|
103
128
|
ffi (>= 0.5.0)
|
|
104
|
-
rb-kqueue (0.2.
|
|
129
|
+
rb-kqueue (0.2.4)
|
|
105
130
|
ffi (>= 0.5.0)
|
|
106
|
-
rubocop (0.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
powerpack (~> 0.0.6)
|
|
131
|
+
rubocop (0.39.0)
|
|
132
|
+
parser (>= 2.3.0.7, < 3.0)
|
|
133
|
+
powerpack (~> 0.1)
|
|
110
134
|
rainbow (>= 1.99.1, < 3.0)
|
|
111
|
-
ruby-progressbar (~> 1.
|
|
112
|
-
|
|
135
|
+
ruby-progressbar (~> 1.7)
|
|
136
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
|
137
|
+
ruby-macho (1.4.0)
|
|
138
|
+
ruby-progressbar (1.7.5)
|
|
113
139
|
safe_yaml (1.0.4)
|
|
114
|
-
simplecov (0.9.
|
|
140
|
+
simplecov (0.9.2)
|
|
115
141
|
docile (~> 1.1.0)
|
|
116
142
|
multi_json (~> 1.0)
|
|
117
|
-
simplecov-html (~> 0.
|
|
118
|
-
simplecov-html (0.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
tzinfo (1.2.2)
|
|
143
|
+
simplecov-html (~> 0.9.0)
|
|
144
|
+
simplecov-html (0.9.0)
|
|
145
|
+
thread_safe (0.3.6)
|
|
146
|
+
tzinfo (1.2.5)
|
|
122
147
|
thread_safe (~> 0.1)
|
|
123
|
-
|
|
148
|
+
unicode-display_width (1.0.3)
|
|
149
|
+
webmock (3.5.1)
|
|
124
150
|
addressable (>= 2.3.6)
|
|
125
151
|
crack (>= 0.3.2)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
152
|
+
hashdiff
|
|
153
|
+
xcodeproj (1.12.0)
|
|
154
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
|
155
|
+
atomos (~> 0.1.3)
|
|
156
|
+
claide (>= 1.0.2, < 2.0)
|
|
157
|
+
colored2 (~> 3.1)
|
|
158
|
+
nanaimo (~> 0.2.6)
|
|
129
159
|
|
|
130
160
|
PLATFORMS
|
|
131
161
|
ruby
|
|
@@ -138,11 +168,14 @@ DEPENDENCIES
|
|
|
138
168
|
cocoapods-core!
|
|
139
169
|
cocoapods-trunk!
|
|
140
170
|
codeclimate-test-reporter
|
|
141
|
-
json
|
|
171
|
+
json!
|
|
142
172
|
kicker
|
|
143
173
|
mocha
|
|
144
174
|
mocha-on-bacon
|
|
145
175
|
prettybacon
|
|
146
|
-
rake
|
|
176
|
+
rake (~> 10.0)
|
|
147
177
|
rubocop
|
|
148
178
|
webmock
|
|
179
|
+
|
|
180
|
+
BUNDLED WITH
|
|
181
|
+
1.17.3
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CocoaPods::Trunk
|
|
2
2
|
|
|
3
3
|
[](https://travis-ci.org/CocoaPods/cocoapods-trunk)
|
|
4
4
|
[](https://codeclimate.com/github/CocoaPods/cocoapods-trunk)
|
data/cocoapods-trunk.gemspec
CHANGED
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.authors = ["Eloy Durán"]
|
|
10
10
|
spec.email = ["eloy.de.enige@gmail.com"]
|
|
11
11
|
spec.summary = "Interact with trunk.cocoapods.org"
|
|
12
|
-
spec.homepage = ""
|
|
12
|
+
spec.homepage = "https://github.com/CocoaPods/cocoapods-trunk"
|
|
13
13
|
spec.license = "MIT"
|
|
14
14
|
|
|
15
15
|
spec.files = `git ls-files`.split($/)
|
|
@@ -17,10 +17,10 @@ Gem::Specification.new do |spec|
|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
18
18
|
spec.require_paths = ["lib"]
|
|
19
19
|
|
|
20
|
-
spec.add_dependency 'nap', '>= 0.8'
|
|
21
|
-
spec.add_dependency 'netrc', '0.
|
|
20
|
+
spec.add_dependency 'nap', '>= 0.8', '< 2.0'
|
|
21
|
+
spec.add_dependency 'netrc', '~> 0.11'
|
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.3"
|
|
23
|
-
spec.add_development_dependency "rake"
|
|
23
|
+
spec.add_development_dependency "rake", '~> 10.0'
|
|
24
24
|
|
|
25
25
|
spec.required_ruby_version = '>= 2.0.0'
|
|
26
26
|
end
|
data/lib/cocoapods_trunk.rb
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
module Pod
|
|
2
2
|
class Command
|
|
3
3
|
class Trunk
|
|
4
|
+
# @CocoaPods 0.33.0
|
|
5
|
+
#
|
|
4
6
|
class AddOwner < Trunk
|
|
5
7
|
self.summary = 'Add an owner to a pod'
|
|
6
8
|
self.description = <<-DESC
|
|
@@ -16,7 +18,8 @@ module Pod
|
|
|
16
18
|
]
|
|
17
19
|
|
|
18
20
|
def initialize(argv)
|
|
19
|
-
@pod
|
|
21
|
+
@pod = argv.shift_argument
|
|
22
|
+
@email = argv.shift_argument
|
|
20
23
|
super
|
|
21
24
|
end
|
|
22
25
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
module Pod
|
|
2
|
+
class Command
|
|
3
|
+
class Trunk
|
|
4
|
+
# @CocoaPods 1.0.0.beta.1
|
|
5
|
+
#
|
|
6
|
+
class Delete < Trunk
|
|
7
|
+
self.summary = 'Deletes a version of a pod.'
|
|
8
|
+
self.description = <<-DESC
|
|
9
|
+
WARNING: It is generally considered bad behavior to remove
|
|
10
|
+
versions of a Pod that others are depending on! Please
|
|
11
|
+
consider using the deprecate command instead.
|
|
12
|
+
|
|
13
|
+
Deletes the specified pod version from trunk and the master specs
|
|
14
|
+
repo. Once deleted, this version can never be pushed again.
|
|
15
|
+
DESC
|
|
16
|
+
|
|
17
|
+
self.arguments = [
|
|
18
|
+
CLAide::Argument.new('NAME', true),
|
|
19
|
+
CLAide::Argument.new('VERSION', true),
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
def initialize(argv)
|
|
23
|
+
@name = argv.shift_argument
|
|
24
|
+
@version = argv.shift_argument
|
|
25
|
+
super
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def validate!
|
|
29
|
+
super
|
|
30
|
+
help! 'Please specify a pod name.' unless @name
|
|
31
|
+
help! 'Please specify a version.' unless @version
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def run
|
|
35
|
+
return unless confirm_deletion?
|
|
36
|
+
json = delete
|
|
37
|
+
print_messages(json['data_url'], json['messages'], nil, nil)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
private
|
|
41
|
+
|
|
42
|
+
WARNING_MESSAGE = 'WARNING: It is generally considered bad behavior ' \
|
|
43
|
+
"to remove versions of a Pod that others are depending on!\n" \
|
|
44
|
+
'Please consider using the `deprecate` command instead.'.freeze
|
|
45
|
+
|
|
46
|
+
def confirm_deletion?
|
|
47
|
+
UI.puts(WARNING_MESSAGE.yellow)
|
|
48
|
+
loop do
|
|
49
|
+
UI.print("Are you sure you want to delete this Pod version?\n> ")
|
|
50
|
+
answer = UI.gets.strip.downcase
|
|
51
|
+
UI.puts # ensures a newline is printed after the user input
|
|
52
|
+
affirmatives = %w(y yes true 1)
|
|
53
|
+
negatives = %w(n no false 0)
|
|
54
|
+
return true if affirmatives.include?(answer)
|
|
55
|
+
return false if negatives.include?(answer)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def delete
|
|
60
|
+
response = request_path(:delete, "pods/#{@name}/#{@version}", auth_headers)
|
|
61
|
+
url = response.headers['location'].first
|
|
62
|
+
json(request_url(:get, url, default_headers))
|
|
63
|
+
rescue REST::Error => e
|
|
64
|
+
raise Informative, 'There was an error deleting the pod version ' \
|
|
65
|
+
"from trunk: #{e.message}"
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module Pod
|
|
2
|
+
class Command
|
|
3
|
+
class Trunk
|
|
4
|
+
# @CocoaPods 1.0.0.beta.1
|
|
5
|
+
#
|
|
6
|
+
class Deprecate < Trunk
|
|
7
|
+
self.summary = 'Deprecates a pod.'
|
|
8
|
+
self.arguments = [
|
|
9
|
+
CLAide::Argument.new('NAME', true),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
def self.options
|
|
13
|
+
[
|
|
14
|
+
['--in-favor-of=OTHER_NAME', 'The pod to deprecate this pod in favor of.'],
|
|
15
|
+
].concat(super)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def initialize(argv)
|
|
19
|
+
@name = argv.shift_argument
|
|
20
|
+
@in_favor_of = argv.option('in-favor-of')
|
|
21
|
+
super
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def validate!
|
|
25
|
+
super
|
|
26
|
+
help! 'Please specify a pod name.' unless @name
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def run
|
|
30
|
+
json = deprecate
|
|
31
|
+
print_messages(json['data_url'], json['messages'], nil, nil)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def deprecate
|
|
35
|
+
body = {
|
|
36
|
+
:in_favor_of => @in_favor_of,
|
|
37
|
+
}.to_json
|
|
38
|
+
response = request_path(:patch, "pods/#{@name}/deprecated", body, auth_headers)
|
|
39
|
+
url = response.headers['location'].first
|
|
40
|
+
json(request_url(:get, url, default_headers))
|
|
41
|
+
rescue REST::Error => e
|
|
42
|
+
raise Informative, 'There was an error deprecating the pod ' \
|
|
43
|
+
"via trunk: #{e.message}"
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
data/lib/pod/command/trunk/me.rb
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
module Pod
|
|
2
2
|
class Command
|
|
3
3
|
class Trunk
|
|
4
|
+
# @CocoaPods 0.33.0
|
|
5
|
+
#
|
|
4
6
|
class Push < Trunk
|
|
5
7
|
self.summary = 'Publish a podspec'
|
|
6
8
|
self.description = <<-DESC
|
|
7
9
|
Publish the podspec at `PATH` to make it available to all users of
|
|
8
|
-
the ‘
|
|
10
|
+
the ‘trunk’ spec-repo. If `PATH` is not provided, defaults to the
|
|
9
11
|
current directory.
|
|
10
12
|
|
|
11
13
|
Before pushing the podspec to cocoapods.org, this will perform a local
|
|
@@ -29,12 +31,21 @@ module Pod
|
|
|
29
31
|
[
|
|
30
32
|
['--allow-warnings', 'Allows push even if there are lint warnings'],
|
|
31
33
|
['--use-libraries', 'Linter uses static libraries to install the spec'],
|
|
34
|
+
['--use-modular-headers', 'Lint uses modular headers during installation'],
|
|
35
|
+
['--swift-version=VERSION', 'The SWIFT_VERSION that should be used to lint the spec. ' \
|
|
36
|
+
'This takes precedence over a .swift-version file.'],
|
|
37
|
+
['--skip-import-validation', 'Lint skips validating that the pod can be imported'],
|
|
38
|
+
['--skip-tests', 'Lint skips building and running tests during validation'],
|
|
32
39
|
].concat(super)
|
|
33
40
|
end
|
|
34
41
|
|
|
35
42
|
def initialize(argv)
|
|
36
|
-
@allow_warnings = argv.flag?('allow-warnings')
|
|
43
|
+
@allow_warnings = argv.flag?('allow-warnings', false)
|
|
37
44
|
@use_frameworks = !argv.flag?('use-libraries')
|
|
45
|
+
@use_modular_headers = argv.flag?('use-modular-headers')
|
|
46
|
+
@swift_version = argv.option('swift-version', nil)
|
|
47
|
+
@skip_import_validation = argv.flag?('skip-import-validation', false)
|
|
48
|
+
@skip_tests = argv.flag?('skip-tests', false)
|
|
38
49
|
@path = argv.shift_argument || '.'
|
|
39
50
|
find_podspec_file if File.directory?(@path)
|
|
40
51
|
super
|
|
@@ -43,7 +54,7 @@ module Pod
|
|
|
43
54
|
def validate!
|
|
44
55
|
super
|
|
45
56
|
unless token
|
|
46
|
-
help! 'You need to register a session first.'
|
|
57
|
+
help! 'You need to run `pod trunk register` to register a session first.'
|
|
47
58
|
end
|
|
48
59
|
unless @path
|
|
49
60
|
help! 'Please specify the path to the podspec file.'
|
|
@@ -55,27 +66,31 @@ module Pod
|
|
|
55
66
|
end
|
|
56
67
|
|
|
57
68
|
def run
|
|
69
|
+
update_master_repo
|
|
58
70
|
validate_podspec
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
json = json(request_url(:get, url, default_headers))
|
|
62
|
-
|
|
63
|
-
# Using UI.labeled here is dangerous, as it wraps the URL and indents
|
|
64
|
-
# it, which breaks the URL when you try to copy-paste it.
|
|
65
|
-
$stdout.puts " - Data URL: #{json['data_url']}"
|
|
71
|
+
status, json = push_to_trunk
|
|
72
|
+
update_master_repo
|
|
66
73
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
if (400...600).cover?(status)
|
|
75
|
+
print_messages(json['data_url'], json['messages'], nil)
|
|
76
|
+
else
|
|
77
|
+
print_messages(json['data_url'], json['messages'], spec, 'published')
|
|
70
78
|
end
|
|
71
|
-
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
private
|
|
82
|
+
|
|
83
|
+
def push_to_trunk
|
|
84
|
+
spec.attributes_hash[:pushed_with_swift_version] = @swift_version if @swift_version
|
|
85
|
+
response = request_path(:post, "pods?allow_warnings=#{@allow_warnings}",
|
|
86
|
+
spec.to_json, auth_headers)
|
|
87
|
+
url = response.headers['location'].first
|
|
88
|
+
return response.status_code, json(request_url(:get, url, default_headers))
|
|
72
89
|
rescue REST::Error => e
|
|
73
90
|
raise Informative, 'There was an error pushing a new version ' \
|
|
74
91
|
"to trunk: #{e.message}"
|
|
75
92
|
end
|
|
76
93
|
|
|
77
|
-
private
|
|
78
|
-
|
|
79
94
|
def find_podspec_file
|
|
80
95
|
podspecs = Dir[Pathname(@path) + '*.podspec{.json,}']
|
|
81
96
|
case podspecs.count
|
|
@@ -92,9 +107,9 @@ module Pod
|
|
|
92
107
|
|
|
93
108
|
def spec
|
|
94
109
|
@spec ||= Pod::Specification.from_file(@path)
|
|
95
|
-
rescue Informative # TODO: this should be a more specific error
|
|
96
|
-
raise Informative, 'Unable to interpret the specified path
|
|
97
|
-
|
|
110
|
+
rescue Informative => e # TODO: this should be a more specific error
|
|
111
|
+
raise Informative, 'Unable to interpret the specified path ' \
|
|
112
|
+
"#{UI.path(@path)} as a podspec (#{e})."
|
|
98
113
|
end
|
|
99
114
|
|
|
100
115
|
# Performs a full lint against the podspecs.
|
|
@@ -103,12 +118,49 @@ module Pod
|
|
|
103
118
|
def validate_podspec
|
|
104
119
|
UI.puts 'Validating podspec'.yellow
|
|
105
120
|
|
|
106
|
-
validator = Validator.new(spec,
|
|
121
|
+
validator = Validator.new(spec, [master_repo_url])
|
|
107
122
|
validator.allow_warnings = @allow_warnings
|
|
108
123
|
validator.use_frameworks = @use_frameworks
|
|
124
|
+
if validator.respond_to?(:use_modular_headers=)
|
|
125
|
+
validator.use_modular_headers = @use_modular_headers
|
|
126
|
+
end
|
|
127
|
+
if validator.respond_to?(:swift_version=)
|
|
128
|
+
validator.swift_version = @swift_version
|
|
129
|
+
end
|
|
130
|
+
validator.skip_import_validation = @skip_import_validation
|
|
131
|
+
validator.skip_tests = @skip_tests
|
|
109
132
|
validator.validate
|
|
110
133
|
unless validator.validated?
|
|
111
|
-
raise Informative,
|
|
134
|
+
raise Informative, "The spec did not pass validation, due to #{validator.failure_reason}."
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Let the validator's logic for the swift version
|
|
138
|
+
# set the value for the trunk JSON uploader
|
|
139
|
+
@swift_version = validator.respond_to?(:used_swift_version) && validator.used_swift_version
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def update_master_repo
|
|
143
|
+
# more robust Trunk setup logic:
|
|
144
|
+
# - if Trunk exists, updates it
|
|
145
|
+
# - if Trunk doesn't exist, add it and update it
|
|
146
|
+
#
|
|
147
|
+
trunk = sources_manager.find_or_create_source_with_url(Pod::TrunkSource::TRUNK_REPO_URL)
|
|
148
|
+
sources_manager.update(trunk.name)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def master_repo_name
|
|
152
|
+
sources_manager.master.first.name
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def master_repo_url
|
|
156
|
+
sources_manager.master.first.url
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def sources_manager
|
|
160
|
+
if defined?(Pod::SourcesManager)
|
|
161
|
+
Pod::SourcesManager
|
|
162
|
+
else
|
|
163
|
+
config.sources_manager
|
|
112
164
|
end
|
|
113
165
|
end
|
|
114
166
|
end
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
module Pod
|
|
2
2
|
class Command
|
|
3
3
|
class Trunk
|
|
4
|
+
# @CocoaPods 0.33.0
|
|
5
|
+
#
|
|
4
6
|
class Register < Trunk
|
|
5
7
|
self.summary = 'Manage sessions'
|
|
6
8
|
self.description = <<-DESC
|
|
7
9
|
Register a new account, or create a new session.
|
|
8
10
|
|
|
9
|
-
If this is your first registration, both an `EMAIL` address and
|
|
10
|
-
`
|
|
11
|
-
omit the `
|
|
11
|
+
If this is your first registration, both an `EMAIL` address and
|
|
12
|
+
`YOUR_NAME` are required. If you’ve already registered with trunk, you may
|
|
13
|
+
omit the `YOUR_NAME` (unless you would like to change it).
|
|
12
14
|
|
|
13
15
|
It is recommended that you provide a description of the session, so
|
|
14
16
|
that it will be easier to identify later on. For instance, when you
|
|
@@ -25,7 +27,7 @@ module Pod
|
|
|
25
27
|
|
|
26
28
|
self.arguments = [
|
|
27
29
|
CLAide::Argument.new('EMAIL', true),
|
|
28
|
-
CLAide::Argument.new('
|
|
30
|
+
CLAide::Argument.new('YOUR_NAME', false),
|
|
29
31
|
]
|
|
30
32
|
|
|
31
33
|
def self.options
|
|
@@ -38,7 +40,8 @@ module Pod
|
|
|
38
40
|
|
|
39
41
|
def initialize(argv)
|
|
40
42
|
@session_description = argv.option('description')
|
|
41
|
-
@email
|
|
43
|
+
@email = argv.shift_argument
|
|
44
|
+
@name = argv.shift_argument
|
|
42
45
|
super
|
|
43
46
|
end
|
|
44
47
|
|
|
@@ -58,8 +61,8 @@ module Pod
|
|
|
58
61
|
json = json(request_path(:post, 'sessions', body, default_headers))
|
|
59
62
|
save_token(json['token'])
|
|
60
63
|
# TODO UI.notice inserts an empty line :/
|
|
61
|
-
puts '[!] Please verify the session by clicking the link in the ' \
|
|
62
|
-
|
|
64
|
+
UI.puts '[!] Please verify the session by clicking the link in the ' \
|
|
65
|
+
"verification email that has been sent to #{@email}".yellow
|
|
63
66
|
rescue REST::Error => e
|
|
64
67
|
raise Informative, 'There was an error registering with trunk: ' \
|
|
65
68
|
"#{e.message}"
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
module Pod
|
|
2
2
|
class Command
|
|
3
3
|
class Trunk
|
|
4
|
+
# @CocoaPods 0.33.0
|
|
5
|
+
#
|
|
4
6
|
class RemoveOwner < Trunk
|
|
5
7
|
self.summary = 'Remove an owner from a pod'
|
|
6
8
|
self.description = <<-DESC
|
|
@@ -16,7 +18,8 @@ module Pod
|
|
|
16
18
|
]
|
|
17
19
|
|
|
18
20
|
def initialize(argv)
|
|
19
|
-
@pod
|
|
21
|
+
@pod = argv.shift_argument
|
|
22
|
+
@email = argv.shift_argument
|
|
20
23
|
super
|
|
21
24
|
end
|
|
22
25
|
|