Commit eeeef232 authored by Fabio Pelosin's avatar Fabio Pelosin

Merge branch 'master' of github.com:CocoaPods/CocoaPods

* 'master' of github.com:CocoaPods/CocoaPods:
  Fix integration spec, which was trying to assign a source to subspecs.
  Fix spec that was using a newer version of lib than expected.
  Update spec repo fixture to latest 0.6 and fix CP version checking.
  Fix a RubyGems specific version spec failure.
  Update SSToolkit fixture submodule.
  Fix version number.

Conflicts:
	lib/cocoapods/command/repo.rb
parents 8a1a5d30 d230d8e3
Encoding.default_external = Encoding::UTF_8 if RUBY_VERSION > '1.8.7' Encoding.default_external = Encoding::UTF_8 if RUBY_VERSION > '1.8.7'
module Pod module Pod
VERSION = '0.6.0rc1' VERSION = '0.6.0.rc1'
class Informative < StandardError class Informative < StandardError
def message def message
......
...@@ -89,9 +89,12 @@ module Pod ...@@ -89,9 +89,12 @@ module Pod
else else
add_master_repo_command.run add_master_repo_command.run
end end
hook = config.repos_dir + 'master/.git/hooks/pre-commit' # Mainly so the specs run with submodule repos
if (dir + '.git/hooks').exist?
hook = dir + '.git/hooks/pre-commit'
hook.open('w') { |f| f << "#!/bin/sh\nrake lint" } hook.open('w') { |f| f << "#!/bin/sh\nrake lint" }
`chmod +x '#{hook}'` `chmod +x '#{hook}'`
end
puts "Setup completed (#{push? ? "push" : "read-only"} access)" unless config.silent puts "Setup completed (#{push? ? "push" : "read-only"} access)" unless config.silent
end end
end end
......
...@@ -270,6 +270,10 @@ module Pod ...@@ -270,6 +270,10 @@ module Pod
@parent ? @parent.top_level_parent : self @parent ? @parent.top_level_parent : self
end end
def subspec?
!@parent.nil?
end
def subspec(name, &block) def subspec(name, &block)
subspec = Specification.new(self, name, &block) subspec = Specification.new(self, name, &block)
@subspecs << subspec @subspecs << subspec
......
...@@ -7,7 +7,12 @@ describe "Pod::Command::Setup" do ...@@ -7,7 +7,12 @@ describe "Pod::Command::Setup" do
extend SpecHelper::TemporaryRepos extend SpecHelper::TemporaryRepos
it "runs with correct parameters" do it "runs with correct parameters" do
begin
before, config.repos_dir = config.repos_dir, fixture('spec-repos')
lambda { run_command('setup') }.should.not.raise lambda { run_command('setup') }.should.not.raise
ensure
config.repos_dir = before
end
end end
it "complains for wrong parameters" do it "complains for wrong parameters" do
......
...@@ -9,6 +9,7 @@ module SpecHelper ...@@ -9,6 +9,7 @@ module SpecHelper
def specs_by_target def specs_by_target
@specs_by_target ||= super.tap do |hash| @specs_by_target ||= super.tap do |hash|
hash.values.flatten.each do |spec| hash.values.flatten.each do |spec|
next if spec.subspec?
source = spec.source source = spec.source
source[:git] = SpecHelper.fixture("integration/#{spec.name}").to_s source[:git] = SpecHelper.fixture("integration/#{spec.name}").to_s
spec.source = source spec.source = source
...@@ -167,8 +168,16 @@ else ...@@ -167,8 +168,16 @@ else
installer = SpecHelper::Installer.new(podfile) installer = SpecHelper::Installer.new(podfile)
installer.install! installer.install!
# TODO might be nicer looking to not show the dependencies of the top level spec for each subspec (Reachability).
YAML.load(installer.lock_file.read).should == { YAML.load(installer.lock_file.read).should == {
"PODS" => [{ "ASIHTTPRequest (1.8.1)" => ["Reachability"] }, "JSONKit (1.4)", "Reachability (3.0.0)"], "PODS" => [{ "ASIHTTPRequest (1.8.1)" => ["ASIHTTPRequest/ASIWebPageRequest (= 1.8.1)",
"ASIHTTPRequest/CloudFiles (= 1.8.1)",
"ASIHTTPRequest/S3 (= 1.8.1)",
"Reachability"]},
{ "ASIHTTPRequest/ASIWebPageRequest (1.8.1)" => ["Reachability"] },
{ "ASIHTTPRequest/CloudFiles (1.8.1)" => ["Reachability"] },
{ "ASIHTTPRequest/S3 (1.8.1)" => ["Reachability"] },
"JSONKit (1.4)", "Reachability (3.0.0)"],
"DEPENDENCIES" => ["ASIHTTPRequest", "JSONKit (= 1.4)"] "DEPENDENCIES" => ["ASIHTTPRequest", "JSONKit (= 1.4)"]
} }
...@@ -193,7 +202,7 @@ else ...@@ -193,7 +202,7 @@ else
self.platform :ios self.platform :ios
xcodeproj 'dummy' xcodeproj 'dummy'
dependency 'JSONKit', '1.4' dependency 'JSONKit', '1.4'
dependency 'SSToolkit' dependency 'SSToolkit', '1.0.0'
end end
installer = SpecHelper::Installer.new(podfile) installer = SpecHelper::Installer.new(podfile)
installer.install! installer.install!
......
...@@ -250,7 +250,7 @@ describe "A Pod::Specification, hierarchy" do ...@@ -250,7 +250,7 @@ describe "A Pod::Specification, hierarchy" do
it "uses the spec version for the dependencies" do it "uses the spec version for the dependencies" do
@spec.dependencies. @spec.dependencies.
select { |d| d.name =~ /MainSpec/ }. select { |d| d.name =~ /MainSpec/ }.
all? { |d| d.requirement === Pod::Version.new('0.999') }. all? { |d| d.requirement.to_s == '= 0.999' }.
should.be.true should.be.true
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment