Commit d7c82883 authored by Fabio Pelosin's avatar Fabio Pelosin

[Config] Add support for YAML Podfile

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