cocoapods-core 0.30.0 → 1.15.2
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/README.md +7 -10
- data/lib/cocoapods-core/build_type.rb +121 -0
- data/lib/cocoapods-core/cdn_source.rb +501 -0
- data/lib/cocoapods-core/core_ui.rb +4 -3
- data/lib/cocoapods-core/dependency.rb +100 -73
- data/lib/cocoapods-core/gem_version.rb +1 -2
- data/lib/cocoapods-core/github.rb +32 -5
- data/lib/cocoapods-core/http.rb +86 -0
- data/lib/cocoapods-core/lockfile.rb +161 -56
- data/lib/cocoapods-core/metrics.rb +47 -0
- data/lib/cocoapods-core/platform.rb +99 -11
- data/lib/cocoapods-core/podfile/dsl.rb +623 -124
- data/lib/cocoapods-core/podfile/target_definition.rb +662 -109
- data/lib/cocoapods-core/podfile.rb +138 -65
- data/lib/cocoapods-core/requirement.rb +37 -8
- data/lib/cocoapods-core/source/acceptor.rb +16 -13
- data/lib/cocoapods-core/source/aggregate.rb +79 -103
- data/lib/cocoapods-core/source/health_reporter.rb +9 -18
- data/lib/cocoapods-core/source/manager.rb +488 -0
- data/lib/cocoapods-core/source/metadata.rb +79 -0
- data/lib/cocoapods-core/source.rb +241 -70
- data/lib/cocoapods-core/specification/consumer.rb +187 -47
- data/lib/cocoapods-core/specification/dsl/attribute.rb +49 -85
- data/lib/cocoapods-core/specification/dsl/attribute_support.rb +6 -8
- data/lib/cocoapods-core/specification/dsl/deprecations.rb +9 -126
- data/lib/cocoapods-core/specification/dsl/platform_proxy.rb +30 -20
- data/lib/cocoapods-core/specification/dsl.rb +943 -296
- data/lib/cocoapods-core/specification/json.rb +64 -23
- data/lib/cocoapods-core/specification/linter/analyzer.rb +218 -0
- data/lib/cocoapods-core/specification/linter/result.rb +128 -0
- data/lib/cocoapods-core/specification/linter.rb +310 -309
- data/lib/cocoapods-core/specification/root_attribute_accessors.rb +90 -39
- data/lib/cocoapods-core/specification/set/presenter.rb +35 -71
- data/lib/cocoapods-core/specification/set.rb +42 -96
- data/lib/cocoapods-core/specification.rb +368 -130
- data/lib/cocoapods-core/standard_error.rb +45 -24
- data/lib/cocoapods-core/trunk_source.rb +14 -0
- data/lib/cocoapods-core/vendor/requirement.rb +133 -53
- data/lib/cocoapods-core/vendor/version.rb +197 -156
- data/lib/cocoapods-core/vendor.rb +1 -5
- data/lib/cocoapods-core/version.rb +137 -42
- data/lib/cocoapods-core/yaml_helper.rb +334 -0
- data/lib/cocoapods-core.rb +10 -4
- metadata +100 -27
- data/lib/cocoapods-core/source/abstract_data_provider.rb +0 -71
- data/lib/cocoapods-core/source/file_system_data_provider.rb +0 -150
- data/lib/cocoapods-core/source/github_data_provider.rb +0 -143
- data/lib/cocoapods-core/specification/set/statistics.rb +0 -266
- data/lib/cocoapods-core/yaml_converter.rb +0 -192
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Pod::Vendor
|
2
3
|
|
3
4
|
##
|
@@ -24,6 +25,11 @@ module Pod::Vendor
|
|
24
25
|
# 3. 1.0.a.2
|
25
26
|
# 4. 0.9
|
26
27
|
#
|
28
|
+
# If you want to specify a version restriction that includes both prereleases
|
29
|
+
# and regular releases of the 1.x series this is the best way:
|
30
|
+
#
|
31
|
+
# s.add_dependency 'example', '>= 1.0.0.a', '< 2.0.0'
|
32
|
+
#
|
27
33
|
# == How Software Changes
|
28
34
|
#
|
29
35
|
# Users expect to be able to specify a version constraint that gives them
|
@@ -83,8 +89,8 @@ module Pod::Vendor
|
|
83
89
|
#
|
84
90
|
# * Any "public" release of a gem should have a different version. Normally
|
85
91
|
# that means incrementing the build number. This means a developer can
|
86
|
-
# generate builds all day long
|
87
|
-
#
|
92
|
+
# generate builds all day long, but as soon as they make a public release,
|
93
|
+
# the version must be updated.
|
88
94
|
#
|
89
95
|
# === Examples
|
90
96
|
#
|
@@ -101,26 +107,25 @@ module Pod::Vendor
|
|
101
107
|
# Version 1.1.1:: Fixed a bug in the linked list implementation.
|
102
108
|
# Version 1.1.2:: Fixed a bug introduced in the last fix.
|
103
109
|
#
|
104
|
-
# Client A needs a stack with basic push/pop capability.
|
105
|
-
# original interface (no <tt>top</tt>), so
|
106
|
-
# like:
|
110
|
+
# Client A needs a stack with basic push/pop capability. They write to the
|
111
|
+
# original interface (no <tt>top</tt>), so their version constraint looks like:
|
107
112
|
#
|
108
|
-
# gem 'stack', '
|
113
|
+
# gem 'stack', '>= 0.0'
|
109
114
|
#
|
110
115
|
# Essentially, any version is OK with Client A. An incompatible change to
|
111
|
-
# the library will cause
|
112
|
-
# call Client A optimistic).
|
116
|
+
# the library will cause them grief, but they are willing to take the chance
|
117
|
+
# (we call Client A optimistic).
|
113
118
|
#
|
114
|
-
# Client B is just like Client A except for two things: (1)
|
115
|
-
# <tt>depth</tt> method and (2)
|
116
|
-
# incompatibilities, so
|
119
|
+
# Client B is just like Client A except for two things: (1) They use the
|
120
|
+
# <tt>depth</tt> method and (2) they are worried about future
|
121
|
+
# incompatibilities, so they write their version constraint like this:
|
117
122
|
#
|
118
123
|
# gem 'stack', '~> 0.1'
|
119
124
|
#
|
120
125
|
# The <tt>depth</tt> method was introduced in version 0.1.0, so that version
|
121
126
|
# or anything later is fine, as long as the version stays below version 1.0
|
122
127
|
# where incompatibilities are introduced. We call Client B pessimistic
|
123
|
-
# because
|
128
|
+
# because they are worried about incompatible future changes (it is OK to be
|
124
129
|
# pessimistic!).
|
125
130
|
#
|
126
131
|
# == Preventing Version Catastrophe:
|
@@ -131,8 +136,8 @@ module Pod::Vendor
|
|
131
136
|
# specify your dependency as ">= 2.0.0" then, you're good, right? What
|
132
137
|
# happens if fnord 3.0 comes out and it isn't backwards compatible
|
133
138
|
# with 2.y.z? Your stuff will break as a result of using ">=". The
|
134
|
-
# better route is to specify your dependency with
|
135
|
-
# specifier. They're a tad confusing, so here is how the dependency
|
139
|
+
# better route is to specify your dependency with an "approximate" version
|
140
|
+
# specifier ("~>"). They're a tad confusing, so here is how the dependency
|
136
141
|
# specifiers work:
|
137
142
|
#
|
138
143
|
# Specification From ... To (exclusive)
|
@@ -141,196 +146,232 @@ module Pod::Vendor
|
|
141
146
|
# "~> 3.0.0" 3.0.0 ... 3.1
|
142
147
|
# "~> 3.5" 3.5 ... 4.0
|
143
148
|
# "~> 3.5.0" 3.5.0 ... 3.6
|
149
|
+
# "~> 3" 3.0 ... 4.0
|
150
|
+
#
|
151
|
+
# For the last example, single-digit versions are automatically extended with
|
152
|
+
# a zero to give a sensible result.
|
144
153
|
|
145
|
-
|
146
|
-
|
147
|
-
autoload :Requirement, 'rubygems/requirement'
|
154
|
+
class Gem::Version
|
155
|
+
autoload :Requirement, 'rubygems/requirement'
|
148
156
|
|
149
|
-
|
157
|
+
include Comparable
|
150
158
|
|
151
|
-
|
152
|
-
|
159
|
+
VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?' # :nodoc:
|
160
|
+
ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/ # :nodoc:
|
153
161
|
|
154
|
-
|
155
|
-
|
162
|
+
##
|
163
|
+
# A string representation of this Version.
|
156
164
|
|
157
|
-
|
158
|
-
|
165
|
+
def version
|
166
|
+
@version.dup
|
167
|
+
end
|
159
168
|
|
160
|
-
|
161
|
-
# True if the +version+ string matches RubyGems' requirements.
|
169
|
+
alias to_s version
|
162
170
|
|
163
|
-
|
164
|
-
|
165
|
-
end
|
171
|
+
##
|
172
|
+
# True if the +version+ string matches RubyGems' requirements.
|
166
173
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
#
|
171
|
-
# ver1 = Version.create('1.3.17') # -> (Version object)
|
172
|
-
# ver2 = Version.create(ver1) # -> (ver1)
|
173
|
-
# ver3 = Version.create(nil) # -> nil
|
174
|
-
|
175
|
-
def self.create(input)
|
176
|
-
if input.respond_to? :version then
|
177
|
-
input
|
178
|
-
elsif input.nil? then
|
179
|
-
nil
|
180
|
-
else
|
181
|
-
new input
|
182
|
-
end
|
183
|
-
end
|
174
|
+
def self.correct? version
|
175
|
+
version.to_s =~ ANCHORED_VERSION_PATTERN
|
176
|
+
end
|
184
177
|
|
185
|
-
|
186
|
-
|
187
|
-
|
178
|
+
##
|
179
|
+
# Factory method to create a Version object. Input may be a Version
|
180
|
+
# or a String. Intended to simplify client code.
|
181
|
+
#
|
182
|
+
# ver1 = Version.create('1.3.17') # -> (Version object)
|
183
|
+
# ver2 = Version.create(ver1) # -> (ver1)
|
184
|
+
# ver3 = Version.create(nil) # -> nil
|
185
|
+
|
186
|
+
def self.create input
|
187
|
+
if self === input then # check yourself before you wreck yourself
|
188
|
+
input
|
189
|
+
elsif input.nil? then
|
190
|
+
nil
|
191
|
+
else
|
192
|
+
new input
|
193
|
+
end
|
194
|
+
end
|
188
195
|
|
189
|
-
|
190
|
-
unless self.class.correct?(version)
|
191
|
-
raise ArgumentError, "Malformed version number string #{version}"
|
192
|
-
end
|
196
|
+
@@all = {}
|
193
197
|
|
194
|
-
|
195
|
-
|
196
|
-
end
|
198
|
+
def self.new version # :nodoc:
|
199
|
+
return super unless Gem::Version == self
|
197
200
|
|
198
|
-
|
199
|
-
|
200
|
-
# number is one greater (e.g., 5.3.1 => 5.4).
|
201
|
-
#
|
202
|
-
# Pre-release (alpha) parts, e.g, 5.3.1.b.2 => 5.4, are ignored.
|
201
|
+
@@all[version] ||= super
|
202
|
+
end
|
203
203
|
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
segments.pop if segments.size > 1
|
204
|
+
##
|
205
|
+
# Constructs a Version from the +version+ string. A version string is a
|
206
|
+
# series of digits or ASCII letters separated by dots.
|
208
207
|
|
209
|
-
|
210
|
-
|
211
|
-
|
208
|
+
def initialize version
|
209
|
+
raise ArgumentError, "Malformed version number string #{version}" unless
|
210
|
+
self.class.correct?(version)
|
212
211
|
|
213
|
-
|
214
|
-
|
215
|
-
|
212
|
+
@version = version.to_s.strip.gsub("-",".pre.")
|
213
|
+
@segments = nil
|
214
|
+
end
|
216
215
|
|
217
|
-
|
218
|
-
|
219
|
-
|
216
|
+
##
|
217
|
+
# Return a new version object where the next to the last revision
|
218
|
+
# number is one greater (e.g., 5.3.1 => 5.4).
|
219
|
+
#
|
220
|
+
# Pre-release (alpha) parts, e.g, 5.3.1.b.2 => 5.4, are ignored.
|
221
|
+
|
222
|
+
def bump
|
223
|
+
@bump ||= begin
|
224
|
+
segments = self.segments
|
225
|
+
segments.pop while segments.any? { |s| String === s }
|
226
|
+
segments.pop if segments.size > 1
|
227
|
+
|
228
|
+
segments[-1] = segments[-1].succ
|
229
|
+
self.class.new segments.join(".")
|
230
|
+
end
|
231
|
+
end
|
220
232
|
|
221
|
-
|
222
|
-
|
223
|
-
|
233
|
+
##
|
234
|
+
# A Version is only eql? to another version if it's specified to the
|
235
|
+
# same precision. Version "1.0" is not the same as version "1".
|
224
236
|
|
225
|
-
|
226
|
-
|
227
|
-
|
237
|
+
def eql? other
|
238
|
+
self.class === other and @version == other._version
|
239
|
+
end
|
228
240
|
|
229
|
-
|
230
|
-
|
231
|
-
|
241
|
+
def hash # :nodoc:
|
242
|
+
@version.hash
|
243
|
+
end
|
232
244
|
|
233
|
-
|
234
|
-
|
235
|
-
|
245
|
+
def init_with coder # :nodoc:
|
246
|
+
yaml_initialize coder.tag, coder.map
|
247
|
+
end
|
236
248
|
|
237
|
-
|
238
|
-
|
239
|
-
|
249
|
+
def inspect # :nodoc:
|
250
|
+
"#<#{self.class} #{version.inspect}>"
|
251
|
+
end
|
240
252
|
|
241
|
-
|
242
|
-
|
243
|
-
|
253
|
+
##
|
254
|
+
# Dump only the raw version string, not the complete object. It's a
|
255
|
+
# string for backwards (RubyGems 1.3.5 and earlier) compatibility.
|
244
256
|
|
245
|
-
|
246
|
-
|
247
|
-
|
257
|
+
def marshal_dump
|
258
|
+
[version]
|
259
|
+
end
|
248
260
|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
@hash = nil
|
253
|
-
end
|
261
|
+
##
|
262
|
+
# Load custom marshal format. It's a string for backwards (RubyGems
|
263
|
+
# 1.3.5 and earlier) compatibility.
|
254
264
|
|
255
|
-
|
256
|
-
|
265
|
+
def marshal_load array
|
266
|
+
initialize array[0]
|
267
|
+
end
|
257
268
|
|
258
|
-
|
259
|
-
|
260
|
-
|
269
|
+
def yaml_initialize(tag, map) # :nodoc:
|
270
|
+
@version = map['version']
|
271
|
+
@segments = nil
|
272
|
+
@hash = nil
|
273
|
+
end
|
261
274
|
|
262
|
-
|
263
|
-
|
264
|
-
|
275
|
+
def to_yaml_properties # :nodoc:
|
276
|
+
["@version"]
|
277
|
+
end
|
265
278
|
|
266
|
-
|
267
|
-
|
268
|
-
|
279
|
+
def encode_with coder # :nodoc:
|
280
|
+
coder.add 'version', @version
|
281
|
+
end
|
269
282
|
|
270
|
-
|
271
|
-
|
283
|
+
##
|
284
|
+
# A version is considered a prerelease if it contains a letter.
|
272
285
|
|
273
|
-
|
274
|
-
|
275
|
-
|
286
|
+
def prerelease?
|
287
|
+
unless instance_variable_defined? :@prerelease
|
288
|
+
@prerelease = !!(@version =~ /[a-zA-Z]/)
|
276
289
|
end
|
290
|
+
@prerelease
|
291
|
+
end
|
277
292
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
# old marshaled versions, which don't go through marshal_load.
|
293
|
+
def pretty_print q # :nodoc:
|
294
|
+
q.text "Gem::Version.new(#{version.inspect})"
|
295
|
+
end
|
282
296
|
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
297
|
+
##
|
298
|
+
# The release for this version (e.g. 1.2.0.a -> 1.2.0).
|
299
|
+
# Non-prerelease versions return themselves.
|
300
|
+
|
301
|
+
def release
|
302
|
+
@release ||= if prerelease?
|
303
|
+
segments = self.segments
|
304
|
+
segments.pop while segments.any? { |s| String === s }
|
305
|
+
self.class.new segments.join('.')
|
306
|
+
else
|
307
|
+
self
|
308
|
+
end
|
309
|
+
end
|
287
310
|
|
288
|
-
|
289
|
-
|
311
|
+
def segments # :nodoc:
|
312
|
+
_segments.dup
|
313
|
+
end
|
290
314
|
|
291
|
-
|
292
|
-
|
315
|
+
##
|
316
|
+
# A recommended version for use with a ~> Requirement.
|
293
317
|
|
294
|
-
|
295
|
-
|
296
|
-
segments.push 0 while segments.size < 2
|
318
|
+
def approximate_recommendation
|
319
|
+
segments = self.segments
|
297
320
|
|
298
|
-
|
299
|
-
|
321
|
+
segments.pop while segments.any? { |s| String === s }
|
322
|
+
segments.pop while segments.size > 2
|
323
|
+
segments.push 0 while segments.size < 2
|
300
324
|
|
301
|
-
|
302
|
-
|
303
|
-
# other version is larger, the same, or smaller than this
|
304
|
-
# one. Attempts to compare to something that's not a
|
305
|
-
# <tt>Gem::Version</tt> return +nil+.
|
325
|
+
"~> #{segments.join(".")}"
|
326
|
+
end
|
306
327
|
|
307
|
-
|
308
|
-
|
309
|
-
|
328
|
+
##
|
329
|
+
# Compares this version with +other+ returning -1, 0, or 1 if the
|
330
|
+
# other version is larger, the same, or smaller than this
|
331
|
+
# one. Attempts to compare to something that's not a
|
332
|
+
# <tt>Gem::Version</tt> return +nil+.
|
310
333
|
|
311
|
-
|
312
|
-
|
334
|
+
def <=> other
|
335
|
+
return unless Gem::Version === other
|
336
|
+
return 0 if @version == other._version
|
313
337
|
|
314
|
-
|
315
|
-
|
316
|
-
limit = (lhsize > rhsize ? lhsize : rhsize) - 1
|
338
|
+
lhsegments = _segments
|
339
|
+
rhsegments = other._segments
|
317
340
|
|
318
|
-
|
341
|
+
lhsize = lhsegments.size
|
342
|
+
rhsize = rhsegments.size
|
343
|
+
limit = (lhsize > rhsize ? lhsize : rhsize) - 1
|
319
344
|
|
320
|
-
|
321
|
-
lhs, rhs = lhsegments[i] || 0, rhsegments[i] || 0
|
322
|
-
i += 1
|
345
|
+
i = 0
|
323
346
|
|
324
|
-
|
325
|
-
|
326
|
-
|
347
|
+
while i <= limit
|
348
|
+
lhs, rhs = lhsegments[i] || 0, rhsegments[i] || 0
|
349
|
+
i += 1
|
327
350
|
|
328
|
-
|
329
|
-
|
351
|
+
next if lhs == rhs
|
352
|
+
return -1 if String === lhs && Numeric === rhs
|
353
|
+
return 1 if Numeric === lhs && String === rhs
|
330
354
|
|
331
|
-
|
355
|
+
return lhs <=> rhs
|
332
356
|
end
|
357
|
+
|
358
|
+
return 0
|
333
359
|
end
|
334
360
|
|
361
|
+
protected
|
362
|
+
|
363
|
+
def _version
|
364
|
+
@version
|
365
|
+
end
|
366
|
+
|
367
|
+
def _segments
|
368
|
+
# segments is lazy so it can pick up version values that come from
|
369
|
+
# old marshaled versions, which don't go through marshal_load.
|
370
|
+
# since this version object is cached in @@all, its @segments should be frozen
|
371
|
+
|
372
|
+
@segments ||= @version.scan(/[0-9]+|[a-z]+/i).map do |s|
|
373
|
+
/^\d+$/ =~ s ? s.to_i : s
|
374
|
+
end.freeze
|
375
|
+
end
|
335
376
|
end
|
336
377
|
end
|
@@ -1,9 +1,7 @@
|
|
1
1
|
module Pod
|
2
|
-
|
3
2
|
# Namespaces the vendored modules.
|
4
3
|
#
|
5
4
|
module Vendor
|
6
|
-
|
7
5
|
# Namespaces the classes of RubyGems used by CocoaPods.
|
8
6
|
#
|
9
7
|
# CocoaPods needs to vendor RubyGems because OS X ships with `v1.3.6` which
|
@@ -11,7 +9,7 @@ module Pod
|
|
11
9
|
#
|
12
10
|
# E.g. https://github.com/CocoaPods/CocoaPods/issues/398
|
13
11
|
#
|
14
|
-
# The following classes are copied from RubyGems `
|
12
|
+
# The following classes are copied from RubyGems `v2.6.3`. The changes
|
15
13
|
# performed to the source files are the following:
|
16
14
|
#
|
17
15
|
# - Namespaced in `Pod::Vendor`
|
@@ -19,7 +17,6 @@ module Pod
|
|
19
17
|
# - replaced `::Gem` with `Pod::Vendor::Gem`
|
20
18
|
#
|
21
19
|
module Gem
|
22
|
-
|
23
20
|
require 'cocoapods-core/vendor/version'
|
24
21
|
require 'cocoapods-core/vendor/requirement'
|
25
22
|
|
@@ -48,7 +45,6 @@ module Pod
|
|
48
45
|
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
49
46
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
50
47
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
51
|
-
|
52
48
|
end
|
53
49
|
end
|
54
50
|
end
|