cocoapods-core 0.18.1 → 0.19.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f5057b97903d18d2dc9fbf5d408642218db0419
4
- data.tar.gz: 255f683fd32314431419e620a2227cf36e4ccbd0
3
+ metadata.gz: c399c99ab349e04494bdd2c9567bac5986a94dcd
4
+ data.tar.gz: 208b7c85249adcdf5e4dfec5c6bca57fea487b3f
5
5
  SHA512:
6
- metadata.gz: cfd052918bba6c65eb1c75b9d091ecbf43b26a0d984cb88ebd4d83dcb0254f8e61a2d832ec42ac620c0956612c150e2c8ad7afcaf8bf96ddc972dcdb00657c79
7
- data.tar.gz: fea6ce47e015e85ca5eeb3974a096e0b0db0d38289b12afde5cce7ba147c0c3904efd730a98d4f73b486c7ba3aa22bdd11cf0d2ab7542fa0464a811226077f3b
6
+ metadata.gz: 388ce299694e4dabfc94df92de6beb2f1234dd9b8883caa80a6af6350116d5a6259074ef8c398c136d0309c56c36a4c7e0410806db261e47dbe2ea288c84ef0f
7
+ data.tar.gz: 5f9d1bac5d614a36565044d41e78b3809d342e00adc7b280fb5a80f3724a30b6d1b53a55dc0b921a1a1b9cd995fc0108f51e9625326cbf5be5ba84b2af652bf0
data/README.md CHANGED
@@ -36,7 +36,7 @@ All CocoaPods development happens on GitHub, there is a repository for
36
36
  specs](https://github.com/CocoaPods/Specs). Contributing patches or Pods is
37
37
  really easy and gratifying.
38
38
 
39
- Follow [@CocoaPodsOrg](http://twitter.com/CocoaPodsOrg) to get up to date
39
+ Follow [@CocoaPods](http://twitter.com/CocoaPods) to get up to date
40
40
  information about what's going on in the CocoaPods world.
41
41
 
42
42
  ## License
@@ -54,7 +54,7 @@ module Pod
54
54
  # @example Initialization with an external source.
55
55
  #
56
56
  # Dependency.new('libPusher', {:git => 'example.com/repo.git'})
57
- # Dependency.new('libPusher', {:local => 'path/to/folder'})
57
+ # Dependency.new('libPusher', {:path => 'path/to/folder'})
58
58
  # Dependency.new('libPusher', {:podspec => 'example.com/libPusher.podspec'})
59
59
  #
60
60
  # @overload initialize(name, is_head)
@@ -116,7 +116,13 @@ module Pod
116
116
  # @return [Bool] whether the dependency points to an external source.
117
117
  #
118
118
  def external?
119
- !@external_source.nil?
119
+ !!@external_source
120
+ end
121
+
122
+ # @return [Bool] whether the dependency points to a local path.
123
+ #
124
+ def local?
125
+ external_source && !!(external_source[:path] || external_source[:local])
120
126
  end
121
127
 
122
128
  # Creates a new dependency with the name of the top level spec and the same
@@ -353,6 +359,8 @@ module Pod
353
359
  desc = "`#{source[:svn]}`"
354
360
  elsif source.key?(:podspec)
355
361
  desc = "`#{source[:podspec]}`"
362
+ elsif source.key?(:path)
363
+ desc = "`#{source[:path]}`"
356
364
  elsif source.key?(:local)
357
365
  desc = "`#{source[:local]}`"
358
366
  else
@@ -361,4 +369,5 @@ module Pod
361
369
  "from #{desc}"
362
370
  end
363
371
  end
372
+
364
373
  end
@@ -2,5 +2,5 @@ module Pod
2
2
 
3
3
  # The version of the cocoapods-core.
4
4
  #
5
- CORE_VERSION = '0.18.1' unless defined? Pod::CORE_VERSION
5
+ CORE_VERSION = '0.19.0' unless defined? Pod::CORE_VERSION
6
6
  end
@@ -148,6 +148,12 @@ module Pod
148
148
  locked_dependency
149
149
  end
150
150
 
151
+ # @return [Version] The version of CocoaPods which generated this lockfile.
152
+ #
153
+ def cocoapods_version
154
+ Version.new(internal_data['COCOAPODS'])
155
+ end
156
+
151
157
  #--------------------------------------#
152
158
 
153
159
  # !@group Accessing the internal data.
@@ -194,7 +200,6 @@ module Pod
194
200
  internal_data['SPEC CHECKSUMS'] || {}
195
201
  end
196
202
 
197
-
198
203
  #-------------------------------------------------------------------------#
199
204
 
200
205
  # !@group Comparison with a Podfile
@@ -94,7 +94,7 @@ module Pod
94
94
  # If you wold like to use develop a Pod in tandem with its client
95
95
  # project you can use the `local` option.
96
96
  #
97
- # pod 'AFNetworking', :local => '~/Documents/AFNetworking'
97
+ # pod 'AFNetworking', :path => '~/Documents/AFNetworking'
98
98
  #
99
99
  # Using this option CocoaPods will assume the given folder to be the
100
100
  # root of the Pod and will link the files directly from there in the
@@ -212,17 +212,12 @@ module Pod
212
212
  unless path.exist?
213
213
  raise Informative, "No Podfile exists at path `#{path}`."
214
214
  end
215
- string = File.open(path, 'r:utf-8') { |f| f.read }
216
- # Work around for Rubinius incomplete encoding in 1.9 mode
217
- if string.respond_to?(:encoding) && string.encoding.name != "UTF-8"
218
- string.encode!('UTF-8')
219
- end
220
215
 
221
216
  case path.extname
222
- when ''
223
- Podfile.from_ruby(string, path)
224
- when '.yaml', '.cocoapods'
225
- Podfile.from_yaml(string, path)
217
+ when '', '.podfile'
218
+ Podfile.from_ruby(path)
219
+ when '.yaml'
220
+ Podfile.from_yaml(path)
226
221
  else
227
222
  raise Informative, "Unsupported Podfile format `#{path}`."
228
223
  end
@@ -238,7 +233,12 @@ module Pod
238
233
  #
239
234
  # @return [Podfile] the new Podfile
240
235
  #
241
- def self.from_ruby(string, path = nil)
236
+ def self.from_ruby(path)
237
+ string = File.open(path, 'r:utf-8') { |f| f.read }
238
+ # Work around for Rubinius incomplete encoding in 1.9 mode
239
+ if string.respond_to?(:encoding) && string.encoding.name != "UTF-8"
240
+ string.encode!('UTF-8')
241
+ end
242
242
  podfile = Podfile.new(path) do
243
243
  begin
244
244
  eval(string, nil, path.to_s)
@@ -249,6 +249,27 @@ module Pod
249
249
  podfile
250
250
  end
251
251
 
252
+ # Configures a new Podfile from the given YAML representation.
253
+ #
254
+ # @param [String] yaml
255
+ # The YAML encoded hash which contains the information of the
256
+ # Podfile.
257
+ #
258
+ # @param [Pathname] path
259
+ # The path from which the Podfile is loaded.
260
+ #
261
+ # @return [Podfile] the new Podfile
262
+ #
263
+ def self.from_yaml(path)
264
+ string = File.open(path, 'r:utf-8') { |f| f.read }
265
+ # Work around for Rubinius incomplete encoding in 1.9 mode
266
+ if string.respond_to?(:encoding) && string.encoding.name != "UTF-8"
267
+ string.encode!('UTF-8')
268
+ end
269
+ hash = YAML.load(string)
270
+ from_hash(hash, path)
271
+ end
272
+
252
273
  # Configures a new Podfile from the given hash.
253
274
  #
254
275
  # @param [Hash] hash
@@ -270,22 +291,6 @@ module Pod
270
291
  podfile
271
292
  end
272
293
 
273
- # Configures a new Podfile from the given YAML representation.
274
- #
275
- # @param [String] yaml
276
- # The YAML encoded hash which contains the information of the
277
- # Podfile.
278
- #
279
- # @param [Pathname] path
280
- # The path from which the Podfile is loaded.
281
- #
282
- # @return [Podfile] the new Podfile
283
- #
284
- def self.from_yaml(yaml, path = nil)
285
- hash = YAML.load(yaml)
286
- from_hash(hash)
287
- end
288
-
289
294
  #-------------------------------------------------------------------------#
290
295
 
291
296
  private
@@ -52,16 +52,31 @@ module Pod
52
52
 
53
53
  # @return [Array<String>] the list of the name of all the Pods.
54
54
  #
55
+ # @note Using Pathname#children is sensibly slower.
56
+ #
55
57
  def pods
56
- specs_dir.children.map do |child|
57
- child.basename.to_s if child.directory? && child.basename.to_s != '.git'
58
- end.compact
58
+ specs_dir_as_string = specs_dir.to_s
59
+ Dir.entries(specs_dir).select do |entry|
60
+ valid_name = !(entry =='.' || entry == '..' || entry == '.git')
61
+ valid_name && File.directory?(File.join(specs_dir_as_string, entry))
62
+ end
63
+ end
64
+
65
+ # Returns the set for the Pod with the given name.
66
+ #
67
+ # @param [String] pod_name
68
+ # The name of the Pod.
69
+ #
70
+ # @return [Sets] the set.
71
+ #
72
+ def set(pod_name)
73
+ Specification::Set.new(pod_name, self)
59
74
  end
60
75
 
61
76
  # @return [Array<Sets>] the sets of all the Pods.
62
77
  #
63
78
  def pod_sets
64
- pods.map { |pod| Specification::Set.new(pod, self) }
79
+ pods.map { |pod_name| set(pod_name) }
65
80
  end
66
81
 
67
82
  # @return [Array<Version>] all the available versions for the Pod, sorted
@@ -155,19 +170,20 @@ module Pod
155
170
  # hence is considerably slower.
156
171
  #
157
172
  def search_by_name(query, full_text_search = false)
158
- pod_sets.map do |set|
159
- if full_text_search
173
+ if full_text_search
174
+ pod_sets.map do |set|
160
175
  begin
161
176
  s = set.specification
162
177
  text = "#{s.name} #{s.authors} #{s.summary} #{s.description}"
163
178
  rescue
164
179
  CoreUI.warn "Skipping `#{set.name}` because the podspec contains errors."
165
180
  end
166
- else
167
- text = set.name
168
- end
169
- set if text && text.downcase.include?(query.downcase)
170
- end.compact
181
+ set if text && text.downcase.include?(query.downcase)
182
+ end.compact
183
+ else
184
+ names = pods.select { |pod_name| pod_name.downcase.include?(query.downcase) }
185
+ names.map { |pod_name| set(pod_name) }
186
+ end
171
187
  end
172
188
 
173
189
  #-------------------------------------------------------------------------#
@@ -210,8 +226,8 @@ module Pod
210
226
  def specs_dir
211
227
  unless @specs_dir
212
228
  specs_sub_dir = repo + 'Specs'
213
- if repo.children.include?(specs_sub_dir)
214
- @specs_dir = repo + 'Specs'
229
+ if specs_sub_dir.exist?
230
+ @specs_dir = specs_sub_dir
215
231
  else
216
232
  @specs_dir = repo
217
233
  end
@@ -119,6 +119,10 @@ module Pod
119
119
  #
120
120
  spec_attr_accessor :public_header_files
121
121
 
122
+ # @return [Array<String>] the private headers of the Pod.
123
+ #
124
+ spec_attr_accessor :private_header_files
125
+
122
126
  # @return [Array<String>] A hash where the key represents the
123
127
  # paths of the resources to copy and the values the paths of
124
128
  # the resources that should be copied.
@@ -203,7 +203,7 @@ module Pod
203
203
  :svn => [:folder, :tag, :revision],
204
204
  :hg => [:revision],
205
205
  :http => nil,
206
- :local => nil
206
+ :path => nil
207
207
  }.freeze
208
208
 
209
209
  # @!method source=(source)
@@ -417,11 +417,13 @@ module Pod
417
417
  #
418
418
  # ---
419
419
  #
420
- # Dependencies can specify versions requirements. The use of the spermy
421
- # indicator `~>` is recommended because it provides a good compromise
422
- # between control on the version without being too restrictive.
420
+ # Dependencies can specify versions requirements. The use of the approximate
421
+ # version indicator `~>` is recommended because it provides good
422
+ # control over the version without being too restrictive. For example,
423
+ # `~> 1.0.1` is equivalent to `>= 1.0.1` combined with `< 1.1`. Similarly,
424
+ # `~> 1.0` will match `1.0`, `1.0.1`, `1.1`, but will not upgrade to `2.0`.
423
425
  #
424
- # Pods with too restrictive dependencies, limit their compatibility with
426
+ # Pods with overly restrictive dependencies limit their compatibility with
425
427
  # other Pods.
426
428
  #
427
429
  # @example
@@ -782,6 +784,31 @@ module Pod
782
784
 
783
785
  #------------------#
784
786
 
787
+ # @!method private_header_files=(private_header_files)
788
+ #
789
+ # A list of file patterns that should be used to mark private headers.
790
+ #
791
+ # ---
792
+ #
793
+ # These patterns are matched against the public headers (or all the
794
+ # headers if no public headers have been specified) to exclude those
795
+ # headers which should not be exposed to the user project and which
796
+ # should not be used to generate the documentation.
797
+ #
798
+ # @example
799
+ #
800
+ # spec.private_header_files = "Headers/Private/*.h"
801
+ #
802
+ # @param [String, Array<String>] private_header_files
803
+ # the private headers of the Pod.
804
+ #
805
+ attribute :private_header_files, {
806
+ :container => Array,
807
+ :file_patterns => true,
808
+ }
809
+
810
+ #------------------#
811
+
785
812
  # @!method resources=(resources)
786
813
  #
787
814
  # A list of resources that should be copied into the target bundle.
@@ -198,10 +198,14 @@ module Pod
198
198
  end
199
199
  end
200
200
 
201
+ def _validate_version(v)
202
+ error "The version of the spec should be higher than 0." unless v > Version::ZERO
203
+ end
204
+
201
205
  # Performs validations related to the `summary` attribute.
202
206
  #
203
207
  def _validate_summary(s)
204
- warning "The summary should be short use `description` (max 140 characters)." if s.length > 140
208
+ warning "The summary should be a short version of `description` (max 140 characters)." if s.length > 140
205
209
  warning "The summary is not meaningful." if s =~ /A short description of/
206
210
  warning "The summary should end with proper punctuation." if s !~ /(\.|\?|!)$/
207
211
  end
@@ -128,7 +128,7 @@ module Pod
128
128
  # @return [String] the URL of the source of the Pod.
129
129
  #
130
130
  def source_url
131
- url_keys = [:git, :svn, :http, :hg, :local ]
131
+ url_keys = [:git, :svn, :http, :hg, :path ]
132
132
  key = spec.source.keys.find { |k| url_keys.include?(k) }
133
133
  key ? spec.source[key] : 'No source url'
134
134
  end
@@ -54,15 +54,19 @@ module Pod
54
54
  #
55
55
  def initialize(cache_file = nil, cache_expiration = (60 * 60 * 24 * 3))
56
56
  require 'yaml'
57
- # This is to make sure Faraday doesn't warn the user about the
58
- # `system_timer` gem missing.
59
- old_warn, $-w = $-w, nil
60
57
  begin
61
- require 'faraday'
62
- ensure
63
- $-w = old_warn
58
+ # This is to make sure Faraday doesn't warn the user about the
59
+ # `system_timer` gem missing.
60
+ old_warn, $-w = $-w, nil
61
+ begin
62
+ require 'faraday'
63
+ ensure
64
+ $-w = old_warn
65
+ end
66
+ require 'octokit'
67
+ rescue LoadError
68
+ raise PlainInformative, 'The `octokit` gem is required in order to use the Statistics class.'
64
69
  end
65
- require 'octokit'
66
70
 
67
71
  @cache_file = cache_file
68
72
  @cache_expiration = cache_expiration
@@ -95,7 +95,7 @@ module Pod
95
95
  # clients.
96
96
  #
97
97
  def to_s
98
- if name && version.version != ""
98
+ if name && !version.version.empty?
99
99
  "#{name} (#{version})"
100
100
  elsif name
101
101
  name
@@ -125,6 +125,9 @@ module Pod
125
125
  #
126
126
  def self.name_and_version_from_string(string_reppresenation)
127
127
  match_data = string_reppresenation.match(/(\S*) \((.*)\)/)
128
+ unless match_data
129
+ raise Informative, "Invalid string representation for a Specification: `#{string_reppresenation}`."
130
+ end
128
131
  name = match_data[1]
129
132
  vers = Version.new(match_data[2])
130
133
  [name, vers]
@@ -284,7 +287,7 @@ module Pod
284
287
  # source.
285
288
  #
286
289
  def local?
287
- !source.nil? && !source[:local].nil?
290
+ !!(source[:path] || source[:local]) rescue false
288
291
  end
289
292
 
290
293
  # @return [Bool] whether the specification is supported in the given
@@ -62,6 +62,10 @@ module Pod
62
62
  super(version)
63
63
  end
64
64
 
65
+ # An instance that represents version 0.
66
+ #
67
+ ZERO = new('0')
68
+
65
69
  # @return [String] a string representation that indicates if the version is
66
70
  # head.
67
71
  #
@@ -97,6 +101,45 @@ module Pod
97
101
  def self.correct? version
98
102
  version.to_s =~ ANCHORED_VERSION_PATTERN
99
103
  end
104
+
105
+ #-------------------------------------------------------------------------#
106
+
107
+ # @!group Semantic Versioning
108
+
109
+ SEMANTIC_VERSION_PATTERN = '[0-9]+(\.[0-9]+(\.[0-9]+(-[0-9A-Za-z\-\.]+)?)?)?'
110
+ ANCHORED_SEMANTIC_VERSION_PATTERN = /\A\s*(#{SEMANTIC_VERSION_PATTERN})*\s*\z/
111
+
112
+ # @return [Bool] Whether the version conforms to the Semantic Versioning
113
+ # specification (2.0.0-rc.1).
114
+ #
115
+ # @note This comparison is lenient.
116
+ #
117
+ # @note It doesn't support build identifiers.
118
+ #
119
+ def semantic?
120
+ version.to_s =~ ANCHORED_SEMANTIC_VERSION_PATTERN
121
+ end
122
+
123
+ # @return [Fixnum] The semver major identifier.
124
+ #
125
+ def major
126
+ segments[0]
127
+ end
128
+
129
+ # @return [Fixnum] The semver minor identifier.
130
+ #
131
+ def minor
132
+ segments[1] || 0
133
+ end
134
+
135
+ # @return [Fixnum] The semver patch identifier.
136
+ #
137
+ def patch
138
+ segments[2] || 0
139
+ end
140
+
141
+ #-------------------------------------------------------------------------#
142
+
100
143
  end
101
144
  end
102
145
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.1
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-10 00:00:00.000000000 Z
12
+ date: 2013-04-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -26,33 +26,19 @@ dependencies:
26
26
  - !ruby/object:Gem::Version
27
27
  version: 3.2.13
28
28
  - !ruby/object:Gem::Dependency
29
- name: faraday
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ~>
33
- - !ruby/object:Gem::Version
34
- version: 0.8.1
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ~>
40
- - !ruby/object:Gem::Version
41
- version: 0.8.1
42
- - !ruby/object:Gem::Dependency
43
- name: octokit
29
+ name: rake
44
30
  requirement: !ruby/object:Gem::Requirement
45
31
  requirements:
46
32
  - - ~>
47
33
  - !ruby/object:Gem::Version
48
- version: '1.7'
34
+ version: 10.0.0
49
35
  type: :runtime
50
36
  prerelease: false
51
37
  version_requirements: !ruby/object:Gem::Requirement
52
38
  requirements:
53
39
  - - ~>
54
40
  - !ruby/object:Gem::Version
55
- version: '1.7'
41
+ version: 10.0.0
56
42
  - !ruby/object:Gem::Dependency
57
43
  name: bacon
58
44
  requirement: !ruby/object:Gem::Requirement
@@ -67,20 +53,6 @@ dependencies:
67
53
  - - ~>
68
54
  - !ruby/object:Gem::Version
69
55
  version: '1.1'
70
- - !ruby/object:Gem::Dependency
71
- name: rake
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - ~>
75
- - !ruby/object:Gem::Version
76
- version: 10.0.0
77
- type: :runtime
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ~>
82
- - !ruby/object:Gem::Version
83
- version: 10.0.0
84
56
  description: |-
85
57
  The CocoaPods-Core gem provides support to work with the models of CocoaPods.
86
58
 
@@ -147,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
119
  version: '0'
148
120
  requirements: []
149
121
  rubyforge_project:
150
- rubygems_version: 2.0.0
122
+ rubygems_version: 2.0.3
151
123
  signing_key:
152
124
  specification_version: 3
153
125
  summary: The models of CocoaPods