Commit d7c82883 authored by Fabio Pelosin's avatar Fabio Pelosin

[Config] Add support for YAML Podfile

parent 4d91b1e0
...@@ -146,18 +146,14 @@ module Pod ...@@ -146,18 +146,14 @@ module Pod
# @return [Podfile] The Podfile to use for the current execution. # @return [Podfile] The Podfile to use for the current execution.
# #
def podfile def podfile
@podfile ||= begin @podfile ||= Podfile.from_file(podfile_path) if podfile_path.exist?
Podfile.from_file(podfile_path) if podfile_path.exist?
end
end end
attr_writer :podfile attr_writer :podfile
# @return [Lockfile] The Lockfile to use for the current execution. # @return [Lockfile] The Lockfile to use for the current execution.
# #
def lockfile def lockfile
@lockfile ||= begin @lockfile ||= Lockfile.from_file(lockfile_path) if lockfile_path.exist?
Lockfile.from_file(lockfile_path) if lockfile_path.exist?
end
end end
#--------------------------------------# #--------------------------------------#
...@@ -192,10 +188,9 @@ module Pod ...@@ -192,10 +188,9 @@ module Pod
# #
def podfile_path def podfile_path
unless @podfile_path unless @podfile_path
@podfile_path = installation_root + 'CocoaPods.podfile' path = installation_root + 'Podfile.yaml'
unless @podfile_path.exist? path = installation_root + 'Podfile' unless path.exist?
@podfile_path = installation_root + 'Podfile' @podfile_path = path
end
end end
@podfile_path @podfile_path
end end
......
...@@ -8,6 +8,7 @@ module Pod ...@@ -8,6 +8,7 @@ module Pod
end end
describe "In general" do describe "In general" do
it "returns the singleton config instance" do it "returns the singleton config instance" do
config.should.be.instance_of Config config.should.be.instance_of Config
end end
...@@ -32,9 +33,9 @@ module Pod ...@@ -32,9 +33,9 @@ module Pod
config.podfile_path.should == temporary_directory + 'Podfile' config.podfile_path.should == temporary_directory + 'Podfile'
end end
it "returns the path to the project Podfile if specified with the extension" do it "can detect yaml Podfiles" do
(temporary_directory + 'CocoaPods.podfile').open('w') { |f| f << '# Yo' } (temporary_directory + 'Podfile.yaml').open('w') { |f| f << '# Yo' }
config.podfile_path.should == temporary_directory + 'CocoaPods.podfile' config.podfile_path.should == temporary_directory + 'Podfile.yaml'
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