cocoapods 0.13.0 → 0.14.0.rc1

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.
@@ -174,6 +174,12 @@ module Pod
174
174
  end
175
175
  attr_writer :name
176
176
 
177
+ # @return [String] The name of the pod.
178
+ #
179
+ def pod_name
180
+ top_level_parent.name
181
+ end
182
+
177
183
  ### Attributes that return the first value defined in the chain
178
184
 
179
185
  def platform
@@ -387,14 +393,14 @@ module Pod
387
393
  # Remove this spec's name from the beginning of the name we’re looking for
388
394
  # and take the first component from the remainder, which is the spec we need
389
395
  # to find now.
390
- remainder = name[self.name.size+1..-1].split('/')
391
- subspec_name = remainder.shift
396
+ remainder = name[self.name.size+1..-1]
397
+ raise Informative, "Unable to find a specification named `#{name}' in `#{pod_name}'." unless remainder
398
+ subspec_name = remainder.split('/').shift
392
399
  subspec = subspecs.find { |s| s.name == "#{self.name}/#{subspec_name}" }
400
+ raise Informative, "Unable to find a specification named `#{name}' in `#{pod_name}'." unless subspec
393
401
  # If this was the last component in the name, then return the subspec,
394
402
  # otherwise we recursively keep calling subspec_by_name until we reach the
395
403
  # last one and return that
396
-
397
- raise Informative, "Unable to find a subspec named `#{name}'." unless subspec
398
404
  remainder.empty? ? subspec : subspec.subspec_by_name(name)
399
405
  end
400
406
 
@@ -402,16 +408,8 @@ module Pod
402
408
  !source.nil? && !source[:local].nil?
403
409
  end
404
410
 
405
- def local_path
406
- Pathname.new(File.expand_path(source[:local]))
407
- end
408
-
409
411
  def pod_destroot
410
- if local?
411
- local_path
412
- else
413
- config.project_pods_root + top_level_parent.name
414
- end
412
+ config.project_pods_root + top_level_parent.name
415
413
  end
416
414
 
417
415
  def self.pattern_list(patterns)
@@ -8,22 +8,18 @@ module Pod
8
8
  def initialize(pod_dir)
9
9
  @pod_dir = pod_dir
10
10
  @required_by = []
11
+ @dependencies = []
11
12
  end
12
13
 
13
- def required_by(specification)
14
- # Skip subspecs because the can't require a different version of the top level parent
15
- return if !specification.podfile? && specification.top_level_parent.name == name
16
-
17
- dependency = specification.dependency_by_top_level_spec_name(name)
18
- # TODO we don’t actually do anything in our Version subclass. Maybe we should just remove that.
14
+ def required_by(dependency, dependent_name)
19
15
  unless @required_by.empty? || dependency.requirement.satisfied_by?(Gem::Version.new(required_version.to_s))
20
- # TODO add graph that shows which dependencies led to this.
21
- raise Informative, "#{specification} tries to activate `#{dependency}', " \
16
+ raise Informative, "#{dependent_name} tries to activate `#{dependency}', " \
22
17
  "but already activated version `#{required_version}' " \
23
18
  "by #{@required_by.to_sentence}."
24
19
  end
25
20
  @specification = nil
26
- @required_by << specification
21
+ @required_by << dependent_name
22
+ @dependencies << dependency
27
23
  end
28
24
 
29
25
  def specification_by_name(name)
@@ -31,8 +27,8 @@ module Pod
31
27
  end
32
28
 
33
29
  def dependency
34
- @required_by.inject(Dependency.new(name)) do |previous, spec|
35
- previous.merge(spec.dependency_by_top_level_spec_name(name).to_top_level_spec_dependency)
30
+ @dependencies.inject(Dependency.new(name)) do |previous, dependency|
31
+ previous.merge(dependency.to_top_level_spec_dependency)
36
32
  end
37
33
  end
38
34
 
@@ -76,6 +72,7 @@ module Pod
76
72
  def initialize(specification)
77
73
  @specification = specification
78
74
  @required_by = []
75
+ @dependencies = []
79
76
  end
80
77
 
81
78
  def name
@@ -86,9 +83,9 @@ module Pod
86
83
  self.class === other && name == other.name
87
84
  end
88
85
 
89
- def required_by(specification)
86
+ def required_by(dependency, dependent_name)
90
87
  before = @specification
91
- super(specification)
88
+ super(dependency, dependent_name)
92
89
  ensure
93
90
  @specification = before
94
91
  end
@@ -1,9 +1,26 @@
1
-
2
-
3
1
  module Pod
4
2
  class Version < Gem::Version
3
+
4
+ # @returns A Version described by its #to_s method.
5
+ #
6
+ # @TODO The `from' part of the regexp should be remove before 1.0.0.
7
+ #
8
+ def self.from_string(string)
9
+ if string =~ /HEAD (based on|from) (.*)/
10
+ v = Version.new($2)
11
+ v.head = true
12
+ v
13
+ else
14
+ Version.new(string)
15
+ end
16
+ end
17
+
5
18
  attr_accessor :head
6
19
  alias_method :head?, :head
20
+
21
+ def to_s
22
+ head? ? "HEAD based on #{super}" : super
23
+ end
7
24
  end
8
25
  end
9
26
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
5
- prerelease:
4
+ version: 0.14.0.rc1
5
+ prerelease: 7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Eloy Duran
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-22 00:00:00.000000000 Z
12
+ date: 2012-08-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -191,6 +191,7 @@ files:
191
191
  - lib/cocoapods/command/install.rb
192
192
  - lib/cocoapods/command/linter.rb
193
193
  - lib/cocoapods/command/list.rb
194
+ - lib/cocoapods/command/outdated.rb
194
195
  - lib/cocoapods/command/presenter/cocoa_pod.rb
195
196
  - lib/cocoapods/command/presenter.rb
196
197
  - lib/cocoapods/command/push.rb
@@ -198,6 +199,7 @@ files:
198
199
  - lib/cocoapods/command/search.rb
199
200
  - lib/cocoapods/command/setup.rb
200
201
  - lib/cocoapods/command/spec.rb
202
+ - lib/cocoapods/command/update.rb
201
203
  - lib/cocoapods/command.rb
202
204
  - lib/cocoapods/config.rb
203
205
  - lib/cocoapods/dependency.rb
@@ -219,6 +221,7 @@ files:
219
221
  - lib/cocoapods/installer/user_project_integrator.rb
220
222
  - lib/cocoapods/installer.rb
221
223
  - lib/cocoapods/local_pod.rb
224
+ - lib/cocoapods/lockfile.rb
222
225
  - lib/cocoapods/open_uri.rb
223
226
  - lib/cocoapods/platform.rb
224
227
  - lib/cocoapods/podfile.rb
@@ -250,7 +253,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
253
  version: '0'
251
254
  segments:
252
255
  - 0
253
- hash: -4262586361152659558
256
+ hash: 202149505213323645
254
257
  required_rubygems_version: !ruby/object:Gem::Requirement
255
258
  none: false
256
259
  requirements: