Commit c06de172 authored by Fabio Pelosin's avatar Fabio Pelosin

[Xcodeproj] Rename Project::save_as

parent 3a9f5197
......@@ -17,7 +17,7 @@ GIT
GIT
remote: https://github.com/CocoaPods/Xcodeproj.git
revision: 00c89436cd64b9e26db60fcf8ca99dbd62b01b58
revision: 230cd26ab0c73c70e6017458a8eea920e5f76233
branch: paths-refactor
specs:
xcodeproj (0.9.0)
......
......@@ -377,7 +377,7 @@ module Pod
UI.message "- Writing Xcode project file to #{UI.path sandbox.project_path}" do
pods_project.main_group.sort_by_type!
pods_project['Frameworks'].sort_by_type!
pods_project.save_as(sandbox.project_path)
pods_project.save
end
end
......
......@@ -32,7 +32,7 @@ module Pod
add_pods_library
add_copy_resources_script_phase
add_check_manifest_lock_script_phase
save_user_project
user_project.save
end
end
......@@ -182,14 +182,6 @@ module Pod
end
end
# Saves the changes to the user project to the disk.
#
# @return [void]
#
def save_user_project
user_project.save_as(target.user_project_path)
end
#---------------------------------------------------------------------#
# @!group Private helpers.
......
......@@ -17,8 +17,8 @@ module Pod
it "complains if more than one project exists and none is specified" do
Dir.chdir(temporary_directory) do
Xcodeproj::Project.new('path').save_as(temporary_directory + 'test1.xcodeproj')
Xcodeproj::Project.new('path').save_as(temporary_directory + 'test2.xcodeproj')
Xcodeproj::Project.new(temporary_directory + 'test2.xcodeproj').save
Xcodeproj::Project.new(temporary_directory + 'test1.xcodeproj').save
lambda { run_command('init') }.should.raise Informative
end
end
......@@ -26,14 +26,14 @@ module Pod
it "complains if a Podfile already exists" do
Dir.chdir(temporary_directory) do
(Pathname.pwd + 'Podfile').open('w') { |f| f << "pod 'AFNetworking'" }
Xcodeproj::Project.new('path').save_as(temporary_directory + 'test1.xcodeproj')
Xcodeproj::Project.new(temporary_directory + 'test1.xcodeproj').save
lambda { run_command('init') }.should.raise Informative
end
end
it "creates a Podfile for a project in current directory" do
Dir.chdir(temporary_directory) do
Xcodeproj::Project.new('path').save_as(temporary_directory + 'test1.xcodeproj')
Xcodeproj::Project.new(temporary_directory + 'test1.xcodeproj').save
run_command('init')
Pathname.new(temporary_directory + 'Podfile').exist?.should == true
end
......@@ -41,8 +41,8 @@ module Pod
it "creates a Podfile for a specified project" do
Dir.chdir(temporary_directory) do
Xcodeproj::Project.new('path').save_as(temporary_directory + 'test1.xcodeproj')
Xcodeproj::Project.new('path').save_as(temporary_directory + 'test2.xcodeproj')
Xcodeproj::Project.new(temporary_directory + 'test1.xcodeproj').save
Xcodeproj::Project.new(temporary_directory + 'test2.xcodeproj').save
run_command('init', 'test2.xcodeproj')
Pathname.new(temporary_directory + 'Podfile').exist?.should == true
config.podfile.nil?.should == false
......@@ -51,10 +51,10 @@ module Pod
it "creates a Podfile with targets from the project" do
Dir.chdir(temporary_directory) do
project = Xcodeproj::Project.new('path')
project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj')
target1 = project.new_target(:application, "AppA", :ios)
target2 = project.new_target(:application, "AppB", :ios)
project.save_as(temporary_directory + 'test.xcodeproj')
project.save
run_command('init')
......@@ -73,10 +73,10 @@ module Pod
open(config.default_podfile_path, 'w') { |f| f << "pod 'AFNetworking'" }
project = Xcodeproj::Project.new('path')
project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj')
project.new_target(:application, 'AppA', :ios)
project.save_as(temporary_directory + 'test.xcodeproj')
project.save
run_command('init')
dependencies = config.podfile.target_definitions["AppA"].dependencies
......@@ -92,9 +92,9 @@ module Pod
open(config.default_test_podfile_path, 'w') { |f| f << "pod 'Kiwi'" }
project = Xcodeproj::Project.new('path')
project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj')
project.new_target(:application, "AppTests", :ios)
project.save_as(temporary_directory + 'test.xcodeproj')
project.save
run_command('init')
......@@ -111,9 +111,9 @@ module Pod
open(config.default_test_podfile_path, 'w') { |f| f << "pod 'Kiwi'" }
project = Xcodeproj::Project.new('path')
project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj')
project.new_target(:application, "App", :ios)
project.save_as(temporary_directory + 'test.xcodeproj')
project.save
run_command('init')
......
......@@ -13,7 +13,7 @@ module Pod
before do
sample_project_path = SpecHelper.create_sample_app_copy_from_fixture('SampleProject')
@sample_project = Xcodeproj::Project.open(sample_project_path)
Xcodeproj::Project.new('path').save_as(config.sandbox.project_path)
Xcodeproj::Project.new(config.sandbox.project_path).save
@target = @sample_project.targets.first
target_definition = Podfile::TargetDefinition.new('Pods', nil)
target_definition.link_with_first_target = true
......
......@@ -17,7 +17,7 @@ module Pod
end
end
config.sandbox.project = Project.new(config.sandbox, nil)
Xcodeproj::Project.new('path').save_as(config.sandbox.project_path)
Xcodeproj::Project.new(config.sandbox.project_path).save
@library = AggregateTarget.new(@podfile.target_definitions['Pods'], config.sandbox)
@library.client_root = sample_project_path.dirname
@library.user_project_path = sample_project_path
......
......@@ -348,7 +348,7 @@ module Pod
it "saves the project to the given path" do
path = temporary_directory + 'Pods/Pods.xcodeproj'
@installer.pods_project.expects(:save_as).with(path)
@installer.pods_project.expects(:save)
@installer.send(:write_pod_project)
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