Commit 4ff2ff3a authored by Eloy Duran's avatar Eloy Duran

Default to either Podfile or *.podspec in the current working dir.

parent eed0a91f
#dependency 'doesnotexist'
dependency 'SSZipArchive', '>= 1' dependency 'SSZipArchive', '>= 1'
...@@ -5,7 +6,7 @@ dependency 'SSZipArchive', '>= 1' ...@@ -5,7 +6,7 @@ dependency 'SSZipArchive', '>= 1'
dependency 'ASIWebPageRequest', '= 1.8' dependency 'ASIWebPageRequest', '= 1.8'
# is part of ASIHTTPRequest 1.8 and 1.8.1 # is part of ASIHTTPRequest 1.8 and 1.8.1
dependency 'Reachability' #, '>= 2.0' #dependency 'Reachability' #, '>= 2.0'
# is part of ASIHTTPRequest # is part of ASIHTTPRequest
#dependency 'ASIWebPageRequest', '>= 1.8' #dependency 'ASIWebPageRequest', '>= 1.8'
......
...@@ -31,7 +31,13 @@ module Pod ...@@ -31,7 +31,13 @@ module Pod
end end
def project_podfile def project_podfile
project_root + 'Podfile' unless @project_podfile
@project_podfile = project_root + 'Podfile'
unless @project_podfile.exist?
@project_podfile = project_root.glob('*.podspec').first
end
end
@project_podfile
end end
module Mixin module Mixin
......
...@@ -19,12 +19,24 @@ describe "Pod::Config" do ...@@ -19,12 +19,24 @@ describe "Pod::Config" do
end end
describe "concerning a user's project, which is expected in the current working directory" do describe "concerning a user's project, which is expected in the current working directory" do
extend SpecHelper::TemporaryDirectory
it "returns the path to the project root" do it "returns the path to the project root" do
config.project_root.should == Pathname.pwd config.project_root.should == Pathname.pwd
end end
it "returns the path to the project Podfile" do it "returns the path to the project Podfile if it exists" do
config.project_podfile.should == Pathname.pwd + 'Podfile' (temporary_directory + 'Podfile').open('w') { |f| f << '# Yo' }
Dir.chdir(temporary_directory) do
config.project_podfile.should == Pathname.pwd + 'Podfile'
end
end
it "returns the path to an existing podspec file if a Podfile doesn't exist" do
(temporary_directory + 'Bananas.podspec').open('w') { |f| f << '# Yo' }
Dir.chdir(temporary_directory) do
config.project_podfile.should == Pathname.pwd + 'Bananas.podspec'
end
end end
it "returns the path to the Pods directory that holds the dependencies" do it "returns the path to the Pods directory that holds the dependencies" do
......
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