Skip to content

Commit

Permalink
Make specs green.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Nov 9, 2011
1 parent 55d5c91 commit ddc5ac5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
34 changes: 17 additions & 17 deletions lib/cocoapods/dependency.rb
Expand Up @@ -20,7 +20,7 @@ def initialize(*name_and_version_requirements, &block)
if name_and_version_requirements.last.is_a?(Hash) if name_and_version_requirements.last.is_a?(Hash)
@external_spec_source = name_and_version_requirements.pop @external_spec_source = name_and_version_requirements.pop
end end
super(name_and_version_requirements.first) super(*name_and_version_requirements)


else else
raise Informative, "A dependency needs either a name and version requirements, " \ raise Informative, "A dependency needs either a name and version requirements, " \
Expand All @@ -32,8 +32,7 @@ def initialize(*name_and_version_requirements, &block)
def ==(other) def ==(other)
super && super &&
@only_part_of_other_pod == other.only_part_of_other_pod && @only_part_of_other_pod == other.only_part_of_other_pod &&
@external_spec_source == other.external_spec_source && (@specification ? @specification == other.specification : @external_spec_source == other.external_spec_source)
@specification == other.specification
end end


def external_podspec? def external_podspec?
Expand All @@ -46,22 +45,23 @@ def inline_podspec?


def specification def specification
@specification ||= begin @specification ||= begin
# This is an external podspec if external_podspec?
pod_root = Config.instance.project_pods_root + @name pod_root = Config.instance.project_pods_root + @name
spec = nil spec = nil
if @external_spec_source[:podspec] if @external_spec_source[:podspec]
Config.instance.project_pods_root.mkdir Config.instance.project_pods_root.mkdir
spec = Config.instance.project_pods_root + "#{@name}.podspec" spec = Config.instance.project_pods_root + "#{@name}.podspec"
# can be http, file, etc # can be http, file, etc
require 'open-uri' require 'open-uri'
open(@external_spec_source[:podspec]) do |io| open(@external_spec_source[:podspec]) do |io|
spec.open('w') { |f| f << io.read } spec.open('w') { |f| f << io.read }
end
else
Downloader.for_source(pod_root, @external_spec_source).download
spec = pod_root + "#{@name}.podspec"
end end
else Specification.from_file(spec)
Downloader.for_source(pod_root, @external_spec_source).download
spec = pod_root + "#{@name}.podspec"
end end
Specification.from_file(spec)
end end
end end


Expand Down
1 change: 0 additions & 1 deletion spec/unit/specification_spec.rb
Expand Up @@ -101,7 +101,6 @@
@spec.compiler_flags = "-Wunused-value" @spec.compiler_flags = "-Wunused-value"
@spec.compiler_flags.should == "-Wunused-value -fobj-arc" @spec.compiler_flags.should == "-Wunused-value -fobj-arc"
end end

end end


describe "A Pod::Specification that's part of another pod's source" do describe "A Pod::Specification that's part of another pod's source" do
Expand Down

0 comments on commit ddc5ac5

Please sign in to comment.