cocoapods-core 0.31.1 → 0.32.0
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/lib/cocoapods-core/core_ui.rb +0 -3
- data/lib/cocoapods-core/dependency.rb +2 -5
- data/lib/cocoapods-core/gem_version.rb +1 -2
- data/lib/cocoapods-core/github.rb +2 -5
- data/lib/cocoapods-core/lockfile.rb +9 -12
- data/lib/cocoapods-core/platform.rb +15 -6
- data/lib/cocoapods-core/podfile/dsl.rb +3 -5
- data/lib/cocoapods-core/podfile/target_definition.rb +2 -5
- data/lib/cocoapods-core/podfile.rb +6 -12
- data/lib/cocoapods-core/requirement.rb +3 -7
- data/lib/cocoapods-core/source/abstract_data_provider.rb +6 -9
- data/lib/cocoapods-core/source/acceptor.rb +36 -10
- data/lib/cocoapods-core/source/aggregate.rb +2 -5
- data/lib/cocoapods-core/source/file_system_data_provider.rb +7 -10
- data/lib/cocoapods-core/source/github_data_provider.rb +13 -12
- data/lib/cocoapods-core/source/health_reporter.rb +1 -5
- data/lib/cocoapods-core/source.rb +0 -3
- data/lib/cocoapods-core/specification/consumer.rb +3 -37
- data/lib/cocoapods-core/specification/dsl/attribute.rb +15 -8
- data/lib/cocoapods-core/specification/dsl/attribute_support.rb +0 -2
- data/lib/cocoapods-core/specification/dsl/deprecations.rb +8 -7
- data/lib/cocoapods-core/specification/dsl/platform_proxy.rb +4 -6
- data/lib/cocoapods-core/specification/dsl.rb +146 -144
- data/lib/cocoapods-core/specification/json.rb +1 -3
- data/lib/cocoapods-core/specification/linter/analyzer.rb +93 -0
- data/lib/cocoapods-core/specification/linter/result.rb +113 -0
- data/lib/cocoapods-core/specification/linter.rb +66 -278
- data/lib/cocoapods-core/specification/root_attribute_accessors.rb +26 -16
- data/lib/cocoapods-core/specification/set/presenter.rb +4 -7
- data/lib/cocoapods-core/specification/set/statistics.rb +1 -4
- data/lib/cocoapods-core/specification/set.rb +1 -4
- data/lib/cocoapods-core/specification.rb +10 -10
- data/lib/cocoapods-core/standard_error.rb +3 -5
- data/lib/cocoapods-core/vendor.rb +0 -4
- data/lib/cocoapods-core/version.rb +1 -4
- data/lib/cocoapods-core/{yaml_converter.rb → yaml_helper.rb} +22 -6
- data/lib/cocoapods-core.rb +1 -3
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef59fe8297bc413cb1482805ca6b260f3a340fb4
|
4
|
+
data.tar.gz: 92ca3d425f5058c370a8bf7573d8e7c371299a7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0772a35c2331bfa3c776b69d0eadd804730360eb181f3ca87525d217b1ee1805c63205ca546969310641318047e7ec4c372edddfc9dae5e84c25209923886341
|
7
|
+
data.tar.gz: cfc998b133ab66bfd8247722734c0290406a9d2b878cbbae4880ebb8cf4e785489d2e07449ed9aec2d066e174c0aca0a8f5b4242fbcf046e84fb07f16cc3e7ba
|
@@ -1,9 +1,7 @@
|
|
1
1
|
module Pod
|
2
|
-
|
3
2
|
# Manages the UI output so dependent gems can customize it.
|
4
3
|
#
|
5
4
|
module CoreUI
|
6
|
-
|
7
5
|
def self.puts(message)
|
8
6
|
STDOUT.puts message
|
9
7
|
end
|
@@ -13,6 +11,5 @@ module Pod
|
|
13
11
|
end
|
14
12
|
|
15
13
|
#-------------------------------------------------------------------------#
|
16
|
-
|
17
14
|
end
|
18
15
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
module Pod
|
2
|
-
|
3
2
|
# The Dependency allows to specify dependencies of a {Podfile} or a
|
4
3
|
# {Specification} on a Pod. It stores the name of the dependency, version
|
5
4
|
# requirements and external sources information.
|
@@ -10,7 +9,6 @@ module Pod
|
|
10
9
|
# [MIT license](https://github.com/rubygems/rubygems/blob/master/MIT.txt).
|
11
10
|
#
|
12
11
|
class Dependency
|
13
|
-
|
14
12
|
# @return [String] The name of the Pod described by this dependency.
|
15
13
|
#
|
16
14
|
attr_accessor :name
|
@@ -26,7 +24,7 @@ module Pod
|
|
26
24
|
# `head` of the source repository.
|
27
25
|
#
|
28
26
|
attr_accessor :head
|
29
|
-
alias_method
|
27
|
+
alias_method :head?, :head
|
30
28
|
|
31
29
|
# @overload initialize(name, requirements)
|
32
30
|
#
|
@@ -128,7 +126,7 @@ module Pod
|
|
128
126
|
#
|
129
127
|
def local?
|
130
128
|
if external_source
|
131
|
-
|
129
|
+
external_source[:path] || external_source[:local]
|
132
130
|
end
|
133
131
|
end
|
134
132
|
|
@@ -377,5 +375,4 @@ module Pod
|
|
377
375
|
"from #{desc}"
|
378
376
|
end
|
379
377
|
end
|
380
|
-
|
381
378
|
end
|
@@ -1,11 +1,9 @@
|
|
1
1
|
module Pod
|
2
|
-
|
3
2
|
# Allows to access information about the GitHub repos.
|
4
3
|
#
|
5
4
|
# This class is stored in Core because it might be used by web services.
|
6
5
|
#
|
7
6
|
module GitHub
|
8
|
-
|
9
7
|
# Returns the information of a user.
|
10
8
|
#
|
11
9
|
# @param [String] login
|
@@ -103,7 +101,7 @@ module Pod
|
|
103
101
|
# @return [Nil] if the given url is not a valid github repo url.
|
104
102
|
#
|
105
103
|
def self.repo_id_from_url(url)
|
106
|
-
url[%r{github.com/([
|
104
|
+
url[%r{github.com/([^/]*/[^/]*)\.*}, 1]
|
107
105
|
end
|
108
106
|
|
109
107
|
# Performs a get request with the given URL.
|
@@ -116,7 +114,7 @@ module Pod
|
|
116
114
|
def self.peform_request(url)
|
117
115
|
require 'rest'
|
118
116
|
require 'json'
|
119
|
-
headers = {
|
117
|
+
headers = { 'User-Agent' => 'CocoaPods' }
|
120
118
|
response = REST.get(url, headers)
|
121
119
|
body = JSON.parse(response.body)
|
122
120
|
if response.ok?
|
@@ -129,6 +127,5 @@ module Pod
|
|
129
127
|
end
|
130
128
|
|
131
129
|
#-------------------------------------------------------------------------#
|
132
|
-
|
133
130
|
end
|
134
131
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
module Pod
|
2
|
-
|
3
2
|
# The Lockfile stores information about the pods that were installed by
|
4
3
|
# CocoaPods.
|
5
4
|
#
|
@@ -11,7 +10,6 @@ module Pod
|
|
11
10
|
# need to be installed or removed.
|
12
11
|
#
|
13
12
|
class Lockfile
|
14
|
-
|
15
13
|
# @todo The symbols should be converted to a String and back to symbol
|
16
14
|
# when reading (EXTERNAL SOURCES Download options)
|
17
15
|
|
@@ -40,7 +38,7 @@ module Pod
|
|
40
38
|
def self.from_file(path)
|
41
39
|
return nil unless path.exist?
|
42
40
|
require 'yaml'
|
43
|
-
hash = File.open(path) { |f|
|
41
|
+
hash = File.open(path) { |f| YAMLHelper.load(f) }
|
44
42
|
unless hash && hash.is_a?(Hash)
|
45
43
|
raise Informative, "Invalid Lockfile in `#{path}`"
|
46
44
|
end
|
@@ -184,7 +182,7 @@ module Pod
|
|
184
182
|
# that required the pod.
|
185
183
|
#
|
186
184
|
def external_sources_data
|
187
|
-
@external_sources_data ||= internal_data[
|
185
|
+
@external_sources_data ||= internal_data['EXTERNAL SOURCES'] || {}
|
188
186
|
end
|
189
187
|
|
190
188
|
# @return [Hash{String => Version}] a Hash containing the name of the root
|
@@ -306,19 +304,18 @@ module Pod
|
|
306
304
|
#
|
307
305
|
def to_yaml
|
308
306
|
keys_hint = [
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
307
|
+
'PODS',
|
308
|
+
'DEPENDENCIES',
|
309
|
+
'EXTERNAL SOURCES',
|
310
|
+
'SPEC CHECKSUMS',
|
311
|
+
'COCOAPODS',
|
314
312
|
]
|
315
|
-
|
313
|
+
YAMLHelper.convert_hash(to_hash, keys_hint, "\n\n")
|
316
314
|
end
|
317
315
|
|
318
316
|
#-------------------------------------------------------------------------#
|
319
317
|
|
320
318
|
class << self
|
321
|
-
|
322
319
|
# !@group Generation
|
323
320
|
|
324
321
|
public
|
@@ -434,7 +431,7 @@ module Pod
|
|
434
431
|
#
|
435
432
|
def generate_checksums(specs)
|
436
433
|
checksums = {}
|
437
|
-
specs.select { |spec|
|
434
|
+
specs.select { |spec| spec.defined_in_file }.each do |spec|
|
438
435
|
checksums[spec.root.name] = spec.checksum
|
439
436
|
end
|
440
437
|
checksums
|
@@ -1,14 +1,11 @@
|
|
1
1
|
module Pod
|
2
|
-
|
3
2
|
# A Platform describes an SDK name and deployment target.
|
4
3
|
#
|
5
4
|
class Platform
|
6
|
-
|
7
5
|
# @return [Symbol, String] the name of the SDK represented by the platform.
|
8
6
|
#
|
9
|
-
|
10
|
-
|
11
|
-
end
|
7
|
+
attr_reader :symbolic_name
|
8
|
+
alias_method :name, :symbolic_name
|
12
9
|
|
13
10
|
# @return [Version] the deployment target of the platform.
|
14
11
|
#
|
@@ -89,6 +86,18 @@ module Pod
|
|
89
86
|
end
|
90
87
|
end
|
91
88
|
|
89
|
+
# (see #==)
|
90
|
+
alias_method :eql?, :==
|
91
|
+
|
92
|
+
# Hashes the instance by the platform name and deployment target.
|
93
|
+
#
|
94
|
+
# This adds support to make instances usable as Hash keys.
|
95
|
+
#
|
96
|
+
# @!visibility private
|
97
|
+
def hash
|
98
|
+
name.hash ^ deployment_target.hash
|
99
|
+
end
|
100
|
+
|
92
101
|
# Checks whether a platform supports another one.
|
93
102
|
#
|
94
103
|
# In the context of operating system SDKs, a platform supports another
|
@@ -151,7 +160,7 @@ module Pod
|
|
151
160
|
#
|
152
161
|
def requires_legacy_ios_archs?
|
153
162
|
if name == :ios
|
154
|
-
deployment_target && (deployment_target < Version.new(
|
163
|
+
deployment_target && (deployment_target < Version.new('4.3'))
|
155
164
|
else
|
156
165
|
false
|
157
166
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
module Pod
|
2
2
|
class Podfile
|
3
|
-
|
4
3
|
# The of the methods defined in this file and the order of the methods is
|
5
4
|
# relevant for the documentation generated on
|
6
5
|
# CocoaPods/cocoapods.github.com.
|
@@ -34,7 +33,6 @@ module Pod
|
|
34
33
|
# end
|
35
34
|
#
|
36
35
|
module DSL
|
37
|
-
|
38
36
|
# @!group Dependencies
|
39
37
|
# The Podfile specifies the dependencies of each user target.
|
40
38
|
#
|
@@ -141,13 +139,13 @@ module Pod
|
|
141
139
|
# If a podspec is available from another source outside of the library’s
|
142
140
|
# repo. Consider, for instance, a podspec available via HTTP:
|
143
141
|
#
|
144
|
-
# pod 'JSONKit', :podspec => 'https://
|
142
|
+
# pod 'JSONKit', :podspec => 'https://example.com/JSONKit.podspec'
|
145
143
|
#
|
146
144
|
#
|
147
145
|
# @note This method allow a nil name and the raises to be more
|
148
146
|
# informative.
|
149
147
|
#
|
150
|
-
|
148
|
+
# @note Support for inline podspecs has been deprecated.
|
151
149
|
#
|
152
150
|
# @return [void]
|
153
151
|
#
|
@@ -158,7 +156,7 @@ module Pod
|
|
158
156
|
end
|
159
157
|
|
160
158
|
unless name
|
161
|
-
raise StandardError,
|
159
|
+
raise StandardError, 'A dependency requires a name.'
|
162
160
|
end
|
163
161
|
|
164
162
|
current_target_definition.store_pod(name, *requirements)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
module Pod
|
2
2
|
class Podfile
|
3
|
-
|
4
3
|
# The TargetDefinition stores the information of a CocoaPods static
|
5
4
|
# library. The target definition can be linked with one or more targets of
|
6
5
|
# the user project.
|
@@ -9,7 +8,6 @@ module Pod
|
|
9
8
|
# of the parent.
|
10
9
|
#
|
11
10
|
class TargetDefinition
|
12
|
-
|
13
11
|
# @return [TargetDefinition, Podfile] the parent target definition or the
|
14
12
|
# Podfile if the receiver is root.
|
15
13
|
#
|
@@ -100,8 +98,8 @@ module Pod
|
|
100
98
|
# name.
|
101
99
|
#
|
102
100
|
def label
|
103
|
-
if root? && name ==
|
104
|
-
|
101
|
+
if root? && name == 'Pods'
|
102
|
+
'Pods'
|
105
103
|
elsif exclusive? || parent.nil?
|
106
104
|
"Pods-#{name}"
|
107
105
|
else
|
@@ -622,7 +620,6 @@ module Pod
|
|
622
620
|
end
|
623
621
|
|
624
622
|
#-----------------------------------------------------------------------#
|
625
|
-
|
626
623
|
end
|
627
624
|
end
|
628
625
|
end
|
@@ -2,7 +2,6 @@ require 'cocoapods-core/podfile/dsl'
|
|
2
2
|
require 'cocoapods-core/podfile/target_definition'
|
3
3
|
|
4
4
|
module Pod
|
5
|
-
|
6
5
|
# The Podfile is a specification that describes the dependencies of the
|
7
6
|
# targets of an Xcode project.
|
8
7
|
#
|
@@ -13,7 +12,6 @@ module Pod
|
|
13
12
|
# information of necessary to generate the CocoaPods libraries.
|
14
13
|
#
|
15
14
|
class Podfile
|
16
|
-
|
17
15
|
# @!group DSL support
|
18
16
|
|
19
17
|
include Pod::Podfile::DSL
|
@@ -46,7 +44,7 @@ module Pod
|
|
46
44
|
self.defined_in_file = defined_in_file
|
47
45
|
@internal_hash = internal_hash
|
48
46
|
if block
|
49
|
-
default_target_def = TargetDefinition.new(
|
47
|
+
default_target_def = TargetDefinition.new('Pods', self)
|
50
48
|
default_target_def.link_with_first_target = true
|
51
49
|
@root_target_definitions = [default_target_def]
|
52
50
|
@current_target_definition = default_target_def
|
@@ -60,7 +58,7 @@ module Pod
|
|
60
58
|
# presented to the user.
|
61
59
|
#
|
62
60
|
def to_s
|
63
|
-
|
61
|
+
'Podfile'
|
64
62
|
end
|
65
63
|
|
66
64
|
#-------------------------------------------------------------------------#
|
@@ -194,11 +192,8 @@ module Pod
|
|
194
192
|
to_hash.to_yaml
|
195
193
|
end
|
196
194
|
|
197
|
-
#-------------------------------------------------------------------------#
|
198
|
-
|
199
|
-
public
|
200
|
-
|
201
195
|
# @!group Class methods
|
196
|
+
#-------------------------------------------------------------------------#
|
202
197
|
|
203
198
|
# Initializes a podfile from the file with the given path.
|
204
199
|
#
|
@@ -236,7 +231,7 @@ module Pod
|
|
236
231
|
def self.from_ruby(path)
|
237
232
|
string = File.open(path, 'r:utf-8') { |f| f.read }
|
238
233
|
# Work around for Rubinius incomplete encoding in 1.9 mode
|
239
|
-
if string.respond_to?(:encoding) && string.encoding.name !=
|
234
|
+
if string.respond_to?(:encoding) && string.encoding.name != 'UTF-8'
|
240
235
|
string.encode!('UTF-8')
|
241
236
|
end
|
242
237
|
podfile = Podfile.new(path) do
|
@@ -266,10 +261,10 @@ module Pod
|
|
266
261
|
def self.from_yaml(path)
|
267
262
|
string = File.open(path, 'r:utf-8') { |f| f.read }
|
268
263
|
# Work around for Rubinius incomplete encoding in 1.9 mode
|
269
|
-
if string.respond_to?(:encoding) && string.encoding.name !=
|
264
|
+
if string.respond_to?(:encoding) && string.encoding.name != 'UTF-8'
|
270
265
|
string.encode!('UTF-8')
|
271
266
|
end
|
272
|
-
hash =
|
267
|
+
hash = YAMLHelper.load(string)
|
273
268
|
from_hash(hash, path)
|
274
269
|
end
|
275
270
|
|
@@ -358,6 +353,5 @@ module Pod
|
|
358
353
|
end
|
359
354
|
|
360
355
|
#-------------------------------------------------------------------------#
|
361
|
-
|
362
356
|
end
|
363
357
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
module Pod
|
2
|
-
|
3
2
|
# A Requirement is a set of one or more version restrictions of a
|
4
3
|
# {Dependency}.
|
5
4
|
#
|
@@ -10,8 +9,7 @@ module Pod
|
|
10
9
|
# the Dependency class.
|
11
10
|
#
|
12
11
|
class Requirement < Pod::Vendor::Gem::Requirement
|
13
|
-
|
14
|
-
quoted_operators = OPS.keys.map { |k| Regexp.quote k }.join "|"
|
12
|
+
quoted_operators = OPS.keys.map { |k| Regexp.quote k }.join '|'
|
15
13
|
|
16
14
|
# @return [Regexp] The regular expression used to validate input strings.
|
17
15
|
#
|
@@ -57,19 +55,17 @@ module Pod
|
|
57
55
|
# @return [Array] A tuple representing the requirement.
|
58
56
|
#
|
59
57
|
def self.parse(input)
|
60
|
-
return [
|
58
|
+
return ['=', input] if input.is_a?(Version)
|
61
59
|
|
62
60
|
unless PATTERN =~ input.to_s
|
63
61
|
raise ArgumentError, "Illformed requirement `#{input.inspect}`"
|
64
62
|
end
|
65
63
|
|
66
|
-
operator = Regexp.last_match[1] ||
|
64
|
+
operator = Regexp.last_match[1] || '='
|
67
65
|
version = Version.new(Regexp.last_match[2])
|
68
66
|
[operator, version]
|
69
67
|
end
|
70
68
|
|
71
69
|
#-------------------------------------------------------------------------#
|
72
|
-
|
73
70
|
end
|
74
|
-
|
75
71
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
module Pod
|
2
2
|
class Source
|
3
|
-
|
4
3
|
# Defines the required and the optional methods of a data provider.
|
5
4
|
#
|
6
5
|
class AbstractDataProvider
|
7
|
-
|
8
6
|
public
|
9
7
|
|
10
8
|
# @group Required methods
|
@@ -13,20 +11,20 @@ module Pod
|
|
13
11
|
# @return [String] The name of the source.
|
14
12
|
#
|
15
13
|
def name
|
16
|
-
raise StandardError,
|
14
|
+
raise StandardError, 'Abstract method.'
|
17
15
|
end
|
18
16
|
|
19
17
|
# @return [String] The user friendly type of the source.
|
20
18
|
#
|
21
19
|
def type
|
22
|
-
raise StandardError,
|
20
|
+
raise StandardError, 'Abstract method.'
|
23
21
|
end
|
24
22
|
|
25
23
|
# @return [Array<String>] The list of the name of all the Pods known to
|
26
24
|
# the Source.
|
27
25
|
#
|
28
26
|
def pods
|
29
|
-
raise StandardError,
|
27
|
+
raise StandardError, 'Abstract method.'
|
30
28
|
end
|
31
29
|
|
32
30
|
# @return [Array<String>] All the available versions of a given Pod,
|
@@ -36,7 +34,7 @@ module Pod
|
|
36
34
|
# The name of the Pod.
|
37
35
|
#
|
38
36
|
def versions(name)
|
39
|
-
raise StandardError,
|
37
|
+
raise StandardError, 'Abstract method.'
|
40
38
|
end
|
41
39
|
|
42
40
|
# @return [Specification] The specification for a given version of a Pod.
|
@@ -48,7 +46,7 @@ module Pod
|
|
48
46
|
# The version of the Pod.
|
49
47
|
#
|
50
48
|
def specification(name, version)
|
51
|
-
raise StandardError,
|
49
|
+
raise StandardError, 'Abstract method.'
|
52
50
|
end
|
53
51
|
|
54
52
|
# @return [Specification] The contents of the specification for a given
|
@@ -61,11 +59,10 @@ module Pod
|
|
61
59
|
# the version of the Pod.
|
62
60
|
#
|
63
61
|
def specification_contents(name, version)
|
64
|
-
raise StandardError,
|
62
|
+
raise StandardError, 'Abstract method.'
|
65
63
|
end
|
66
64
|
|
67
65
|
#-----------------------------------------------------------------------#
|
68
|
-
|
69
66
|
end
|
70
67
|
end
|
71
68
|
end
|
@@ -1,12 +1,10 @@
|
|
1
1
|
module Pod
|
2
2
|
class Source
|
3
|
-
|
4
3
|
# Checks whether a podspec can be accepted by a source. The check takes
|
5
4
|
# into account the introduction of 0.0.1 version if there are already
|
6
5
|
# tagged ones or whether there is change in the source.
|
7
6
|
#
|
8
7
|
class Acceptor
|
9
|
-
|
10
8
|
# @return [Source] the source where the podspec should be added.
|
11
9
|
#
|
12
10
|
attr_reader :source
|
@@ -45,7 +43,7 @@ module Pod
|
|
45
43
|
spec = Specification.from_file(spec_path)
|
46
44
|
analyze(spec)
|
47
45
|
rescue
|
48
|
-
[
|
46
|
+
['Unable to load the specification.']
|
49
47
|
end
|
50
48
|
|
51
49
|
private
|
@@ -53,6 +51,31 @@ module Pod
|
|
53
51
|
# @!group Private helpers
|
54
52
|
#-----------------------------------------------------------------------#
|
55
53
|
|
54
|
+
MAX_HTTP_REDIRECTS = 3
|
55
|
+
|
56
|
+
# Resolve potential redirects and return the final URL.
|
57
|
+
#
|
58
|
+
# @return [string]
|
59
|
+
#
|
60
|
+
def get_actual_url(url)
|
61
|
+
redirects = 0
|
62
|
+
loop do
|
63
|
+
require 'rest'
|
64
|
+
response = REST.head(url)
|
65
|
+
|
66
|
+
if [301, 302, 303, 307, 308].include? response.status_code
|
67
|
+
url = response.headers['location'].first
|
68
|
+
redirects += 1
|
69
|
+
else
|
70
|
+
break
|
71
|
+
end
|
72
|
+
|
73
|
+
break unless redirects < MAX_HTTP_REDIRECTS
|
74
|
+
end
|
75
|
+
|
76
|
+
url
|
77
|
+
end
|
78
|
+
|
56
79
|
# Checks whether the source of the proposed specification is different
|
57
80
|
# from the one of the reference specification.
|
58
81
|
#
|
@@ -68,11 +91,15 @@ module Pod
|
|
68
91
|
source = spec.source.values_at(*keys).compact.first
|
69
92
|
old_source = reference_spec(spec).source.values_at(*keys).compact.first
|
70
93
|
unless source == old_source
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
94
|
+
source = get_actual_url(source)
|
95
|
+
old_source = get_actual_url(old_source)
|
96
|
+
unless source == old_source
|
97
|
+
message = "The source of the spec doesn't match with the recorded "
|
98
|
+
message << "ones. Source: `#{source}`. Previous: `#{old_source}`.\n "
|
99
|
+
message << 'Please contact the specs repo maintainers if the'
|
100
|
+
message << 'library changed location.'
|
101
|
+
errors << message
|
102
|
+
end
|
76
103
|
end
|
77
104
|
end
|
78
105
|
|
@@ -104,7 +131,7 @@ module Pod
|
|
104
131
|
return unless previous_spec
|
105
132
|
return unless spec.version == Version.new('0.0.1')
|
106
133
|
unless spec.source[:commit] == previous_spec.source[:commit]
|
107
|
-
errors <<
|
134
|
+
errors << 'Attempt to rewrite the commit of a 0.0.1 version.'
|
108
135
|
end
|
109
136
|
end
|
110
137
|
|
@@ -161,7 +188,6 @@ module Pod
|
|
161
188
|
end
|
162
189
|
|
163
190
|
#-----------------------------------------------------------------------#
|
164
|
-
|
165
191
|
end
|
166
192
|
end
|
167
193
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
module Pod
|
2
2
|
class Source
|
3
|
-
|
4
3
|
# The Aggregate manages a directory of sources repositories.
|
5
4
|
#
|
6
5
|
class Aggregate
|
7
|
-
|
8
6
|
# @return [Pathname] the directory were the repositories are stored.
|
9
7
|
#
|
10
8
|
attr_reader :repos_dir
|
@@ -102,7 +100,7 @@ module Pod
|
|
102
100
|
# @see Source#search
|
103
101
|
#
|
104
102
|
def search(dependency)
|
105
|
-
sources = all.select { |s|
|
103
|
+
sources = all.select { |s| s.search(dependency) }
|
106
104
|
unless sources.empty?
|
107
105
|
Specification::Set.new(dependency.root_name, sources)
|
108
106
|
end
|
@@ -132,7 +130,7 @@ module Pod
|
|
132
130
|
result << Specification::Set.new(pod, sources)
|
133
131
|
end
|
134
132
|
if result.empty?
|
135
|
-
extra =
|
133
|
+
extra = ', author, summary, or description' if full_text_search
|
136
134
|
raise Informative, "Unable to find a pod with name" \
|
137
135
|
"#{extra} matching `#{query}'"
|
138
136
|
end
|
@@ -236,7 +234,6 @@ module Pod
|
|
236
234
|
end
|
237
235
|
|
238
236
|
#-----------------------------------------------------------------------#
|
239
|
-
|
240
237
|
end
|
241
238
|
end
|
242
239
|
end
|
@@ -1,11 +1,9 @@
|
|
1
1
|
module Pod
|
2
2
|
class Source
|
3
|
-
|
4
3
|
# Data provider for a `Pod::Source` backed by a repository hosted in the
|
5
4
|
# file system.
|
6
5
|
#
|
7
6
|
class FileSystemDataProvider < AbstractDataProvider
|
8
|
-
|
9
7
|
# @return [Pathname] The path where the source is stored.
|
10
8
|
#
|
11
9
|
attr_reader :repo
|
@@ -30,7 +28,7 @@ module Pod
|
|
30
28
|
# @return [String] The user friendly type of the source.
|
31
29
|
#
|
32
30
|
def type
|
33
|
-
|
31
|
+
'file system'
|
34
32
|
end
|
35
33
|
|
36
34
|
# @return [Array<String>] The list of the name of all the Pods known to
|
@@ -42,7 +40,7 @@ module Pod
|
|
42
40
|
return nil unless specs_dir
|
43
41
|
specs_dir_as_string = specs_dir.to_s
|
44
42
|
Dir.entries(specs_dir).select do |entry|
|
45
|
-
valid_name =
|
43
|
+
valid_name = entry[0, 1] != '.'
|
46
44
|
valid_name && File.directory?(File.join(specs_dir_as_string, entry))
|
47
45
|
end.sort
|
48
46
|
end
|
@@ -55,13 +53,13 @@ module Pod
|
|
55
53
|
#
|
56
54
|
def versions(name)
|
57
55
|
return nil unless specs_dir
|
58
|
-
raise ArgumentError,
|
56
|
+
raise ArgumentError, 'No name' unless name
|
59
57
|
pod_dir = specs_dir + name
|
60
58
|
return unless pod_dir.exist?
|
61
59
|
pod_dir.children.map do |v|
|
62
60
|
basename = v.basename.to_s
|
63
|
-
basename if v.directory? && basename[0, 1] != '.'
|
64
|
-
end.compact.sort.reverse
|
61
|
+
Version.new(basename) if v.directory? && basename[0, 1] != '.'
|
62
|
+
end.compact.sort.reverse.map(&:to_s)
|
65
63
|
end
|
66
64
|
|
67
65
|
# @return [Specification] The specification for a given version of a Pod.
|
@@ -107,8 +105,8 @@ module Pod
|
|
107
105
|
# @return [Pathname] The path of the specification.
|
108
106
|
#
|
109
107
|
def specification_path(name, version)
|
110
|
-
raise ArgumentError,
|
111
|
-
raise ArgumentError,
|
108
|
+
raise ArgumentError, 'No name' unless name
|
109
|
+
raise ArgumentError, 'No version' unless version
|
112
110
|
return nil unless specs_dir
|
113
111
|
path = specs_dir + name + version.to_s
|
114
112
|
specification_path = path + "#{name}.podspec.json"
|
@@ -144,7 +142,6 @@ module Pod
|
|
144
142
|
end
|
145
143
|
|
146
144
|
#-----------------------------------------------------------------------#
|
147
|
-
|
148
145
|
end
|
149
146
|
end
|
150
147
|
end
|