Commit eae99b2a authored by Eloy Duran's avatar Eloy Duran

Rename Pod::Project::Integrator to Pod::Installer::UserProjectIntegrator.

parent f9e97e7e
module Pod module Pod
class Installer class Installer
autoload :TargetInstaller, 'cocoapods/installer/target_installer' autoload :TargetInstaller, 'cocoapods/installer/target_installer'
autoload :UserProjectIntegrator, 'cocoapods/installer/user_project_integrator'
include Config::Mixin include Config::Mixin
...@@ -88,7 +89,7 @@ module Pod ...@@ -88,7 +89,7 @@ module Pod
puts "* Writing Xcode project file to `#{@sandbox.project_path}'" if config.verbose? puts "* Writing Xcode project file to `#{@sandbox.project_path}'" if config.verbose?
project.save_as(@sandbox.project_path) project.save_as(@sandbox.project_path)
Project::Integrator.new(@user_project_path, @podfile).integrate! if @user_project_path UserProjectIntegrator.new(@user_project_path, @podfile).integrate! if @user_project_path
end end
def run_post_install_hooks def run_post_install_hooks
......
...@@ -2,9 +2,9 @@ require 'xcodeproj/workspace' ...@@ -2,9 +2,9 @@ require 'xcodeproj/workspace'
require 'xcodeproj/project' require 'xcodeproj/project'
module Pod module Pod
class Project class Installer
class Integrator class UserProjectIntegrator
include Pod::Config::Mixin include Pod::Config::Mixin
attr_reader :user_project_path, :user_project attr_reader :user_project_path, :user_project
......
...@@ -12,7 +12,6 @@ end ...@@ -12,7 +12,6 @@ end
module Pod module Pod
class Project < Xcodeproj::Project class Project < Xcodeproj::Project
autoload :Integrator, 'cocoapods/project/integrator'
# Shortcut access to the `Pods' PBXGroup. # Shortcut access to the `Pods' PBXGroup.
def pods def pods
......
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../../spec_helper', __FILE__)
describe Pod::Project::Integrator, 'TODO UNIT SPECS!' do describe Pod::Installer::UserProjectIntegrator do
extend SpecHelper::TemporaryDirectory
before do
@podfile = Pod::Podfile.new do
platform :ios
dependency 'JSONKit'
target :test_runner, :exclusive => true, :link_with => 'TestRunner' do
dependency 'Kiwi'
end
end
@sample_project_path = SpecHelper.create_sample_app_copy_from_fixture('SampleProject')
config.project_root = @sample_project_path.dirname
@integrator = Pod::Project::Integrator.new(@sample_project_path, @podfile)
end
after do
config.project_root = nil
end
it "returns the path to the workspace in the project's root" do
@integrator.workspace_path.should == config.project_root + 'SampleProject.xcworkspace'
end
it "returns the path to the Pods.xcodeproj document" do
@integrator.pods_project_path.should == config.project_root + 'Pods/Pods.xcodeproj'
end
it "returns a Pod::Project::Integrator::Target for each target definition in the Podfile" do
@integrator.targets.map(&:target_definition).should == @podfile.target_definitions.values
end
it "uses the first target in the user's project if no explicit target is specified" do
target_integrator = @integrator.targets.first
target_integrator.target_definition.stubs(:link_with).returns(nil)
target_integrator.targets.should == [Xcodeproj::Project.new(@sample_project_path).targets.first]
end
end
describe Pod::Project::Integrator do
extend SpecHelper::TemporaryDirectory extend SpecHelper::TemporaryDirectory
before do before do
...@@ -59,7 +18,7 @@ describe Pod::Project::Integrator do ...@@ -59,7 +18,7 @@ describe Pod::Project::Integrator do
@sample_project_path = SpecHelper.create_sample_app_copy_from_fixture('SampleProject') @sample_project_path = SpecHelper.create_sample_app_copy_from_fixture('SampleProject')
config.project_root = @sample_project_path.dirname config.project_root = @sample_project_path.dirname
@integrator = Pod::Project::Integrator.new(@sample_project_path, @podfile) @integrator = Pod::Installer::UserProjectIntegrator.new(@sample_project_path, @podfile)
@integrator.integrate! @integrator.integrate!
@sample_project = Xcodeproj::Project.new(@sample_project_path) @sample_project = Xcodeproj::Project.new(@sample_project_path)
end end
......
require File.expand_path('../../spec_helper', __FILE__) require File.expand_path('../../../spec_helper', __FILE__)
TMP_POD_ROOT = ROOT + "tmp" + "podroot" TMP_POD_ROOT = ROOT + "tmp" + "podroot"
......
require File.expand_path('../../../spec_helper', __FILE__)
describe Pod::Installer::UserProjectIntegrator do
extend SpecHelper::TemporaryDirectory
before do
@podfile = Pod::Podfile.new do
platform :ios
dependency 'JSONKit'
target :test_runner, :exclusive => true, :link_with => 'TestRunner' do
dependency 'Kiwi'
end
end
@sample_project_path = SpecHelper.create_sample_app_copy_from_fixture('SampleProject')
config.project_root = @sample_project_path.dirname
@integrator = Pod::Installer::UserProjectIntegrator.new(@sample_project_path, @podfile)
end
after do
config.project_root = nil
end
it "returns the path to the workspace in the project's root" do
@integrator.workspace_path.should == config.project_root + 'SampleProject.xcworkspace'
end
it "returns the path to the Pods.xcodeproj document" do
@integrator.pods_project_path.should == config.project_root + 'Pods/Pods.xcodeproj'
end
it "returns a Pod::Installer::UserProjectIntegrator::Target for each target definition in the Podfile" do
@integrator.targets.map(&:target_definition).should == @podfile.target_definitions.values
end
it "uses the first target in the user's project if no explicit target is specified" do
target_integrator = @integrator.targets.first
target_integrator.target_definition.stubs(:link_with).returns(nil)
target_integrator.targets.should == [Xcodeproj::Project.new(@sample_project_path).targets.first]
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