Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make specs green.

  • Loading branch information...
commit ddc5ac5035c588610741ba9c67909702ed99aefb 1 parent 55d5c91
@alloy authored
Showing with 17 additions and 18 deletions.
  1. +17 −17 lib/cocoapods/dependency.rb
  2. +0 −1  spec/unit/specification_spec.rb
View
34 lib/cocoapods/dependency.rb
@@ -20,7 +20,7 @@ def initialize(*name_and_version_requirements, &block)
if name_and_version_requirements.last.is_a?(Hash)
@external_spec_source = name_and_version_requirements.pop
end
- super(name_and_version_requirements.first)
+ super(*name_and_version_requirements)
else
raise Informative, "A dependency needs either a name and version requirements, " \
@@ -32,8 +32,7 @@ def initialize(*name_and_version_requirements, &block)
def ==(other)
super &&
@only_part_of_other_pod == other.only_part_of_other_pod &&
- @external_spec_source == other.external_spec_source &&
- @specification == other.specification
+ (@specification ? @specification == other.specification : @external_spec_source == other.external_spec_source)
end
def external_podspec?
@@ -46,22 +45,23 @@ def inline_podspec?
def specification
@specification ||= begin
- # This is an external podspec
- pod_root = Config.instance.project_pods_root + @name
- spec = nil
- if @external_spec_source[:podspec]
- Config.instance.project_pods_root.mkdir
- spec = Config.instance.project_pods_root + "#{@name}.podspec"
- # can be http, file, etc
- require 'open-uri'
- open(@external_spec_source[:podspec]) do |io|
- spec.open('w') { |f| f << io.read }
+ if external_podspec?
+ pod_root = Config.instance.project_pods_root + @name
+ spec = nil
+ if @external_spec_source[:podspec]
+ Config.instance.project_pods_root.mkdir
+ spec = Config.instance.project_pods_root + "#{@name}.podspec"
+ # can be http, file, etc
+ require 'open-uri'
+ open(@external_spec_source[:podspec]) do |io|
+ spec.open('w') { |f| f << io.read }
+ end
+ else
+ Downloader.for_source(pod_root, @external_spec_source).download
+ spec = pod_root + "#{@name}.podspec"
end
- else
- Downloader.for_source(pod_root, @external_spec_source).download
- spec = pod_root + "#{@name}.podspec"
+ Specification.from_file(spec)
end
- Specification.from_file(spec)
end
end
View
1  spec/unit/specification_spec.rb
@@ -101,7 +101,6 @@
@spec.compiler_flags = "-Wunused-value"
@spec.compiler_flags.should == "-Wunused-value -fobj-arc"
end
-
end
describe "A Pod::Specification that's part of another pod's source" do
Please sign in to comment.
Something went wrong with that request. Please try again.