Commit 6854a011 authored by Eloy Duran's avatar Eloy Duran

Bye bye config.rootspec.

parent 9afec2a3
......@@ -35,7 +35,7 @@ module Pod
end
def run
unless podfile = config.rootspec
unless podfile = config.podfile
raise Informative, "No `Podfile' found in the current working directory."
end
if @projpath && !File.exist?(@projpath)
......
......@@ -10,7 +10,7 @@ module Pod
@instance = instance
end
attr_accessor :repos_dir, :project_root, :project_pods_root, :rootspec, :clean, :verbose, :silent, :doc, :doc_install, :force_doc
attr_accessor :repos_dir, :project_root, :project_pods_root, :clean, :verbose, :silent, :doc, :doc_install, :force_doc
alias_method :clean?, :clean
alias_method :verbose?, :verbose
alias_method :silent?, :silent
......@@ -45,8 +45,8 @@ module Pod
end
# Returns the spec at the pat returned from `project_podfile`.
def rootspec
@rootspec ||= begin
def podfile
@podfile ||= begin
Podfile.from_file(project_podfile) if project_podfile.exist?
end
end
......@@ -55,14 +55,14 @@ module Pod
require 'colored'
caller.find { |line| line =~ /^(.+.podspec):\d*/ }
puts "[!] The use of `config.ios?` is deprecated and will be removed in version 0.7.#{" Called from: #{$1}" if $1}".red
rootspec.target_definitions[:default].platform == :ios if rootspec
podfile.target_definitions[:default].platform == :ios if podfile
end
def osx?
require 'colored'
caller.find { |line| line =~ /^(.+.podspec):\d*/ }
puts "[!] The use of `config.ios?` is deprecated and will be removed in version 0.7.#{" Called from: #{$1}" if $1}".red
rootspec.target_definitions[:default].platform == :osx if rootspec
podfile.target_definitions[:default].platform == :osx if podfile
end
module Mixin
......
......@@ -201,7 +201,6 @@ else
it "runs the optional post_install callback defined in the Podfile _before_ the project is saved to disk" do
podfile = Pod::Podfile.new do
config.rootspec = self
self.platform platform
dependency 'SSZipArchive'
......@@ -223,9 +222,6 @@ else
# TODO add a simple source file which uses the compiled lib to check that it really really works
it "activates required pods and create a working static library xcode project" do
podfile = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform
dependency 'Reachability', '> 2.0.5' if platform == :ios
dependency 'ASIWebPageRequest', '>= 1.8.1'
......@@ -270,9 +266,6 @@ else
if platform == :ios
it "does not activate pods that are only part of other pods" do
spec = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform
dependency 'Reachability', '2.0.4' # only 2.0.4 is part of ASIHTTPRequest’s source.
end
......@@ -290,9 +283,6 @@ else
it "adds resources to the xcode copy script" do
spec = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform
dependency 'SSZipArchive'
end
......@@ -310,9 +300,6 @@ else
# TODO we need to do more cleaning and/or add a --prune task
it "overwrites an existing project.pbxproj file" do
spec = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform
dependency 'JSONKit'
end
......@@ -320,9 +307,6 @@ else
installer.install!
spec = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform
dependency 'SSZipArchive'
end
......@@ -335,8 +319,6 @@ else
it "creates a project with multiple targets" do
podfile = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform
target(:debug) { dependency 'SSZipArchive' }
target(:test, :exclusive => true) { dependency 'JSONKit' }
......@@ -409,8 +391,6 @@ else
it "should prevent duplication cleaning headers symlinks with multiple targets" do
podfile = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform
target(:debug) { dependency 'SSZipArchive' }
target(:test, :exclusive => true) { dependency 'JSONKit' }
......
......@@ -35,7 +35,6 @@ describe "Pod::Installer" do
platform :osx
dependency 'ASIHTTPRequest'
end
config.rootspec = podfile
installer = Pod::Installer.new(podfile)
pods = installer.activated_specifications.map do |spec|
Pod::LocalPod.new(spec, installer.sandbox, podfile.target_definitions[:default].platform)
......@@ -52,7 +51,6 @@ describe "Pod::Installer" do
dependency 'JSONKit'
end
end
config.rootspec = podfile
installer = Pod::Installer.new(podfile)
installer.target_installers.map(&:target_definition).map(&:name).should == [:not_empty]
end
......
......@@ -10,7 +10,6 @@ describe "Pod::Resolver" do
platform :ios
dependency 'ASIWebPageRequest'
end
config.rootspec = @podfile
@resolver = Pod::Resolver.new(@podfile, stub('sandbox'))
end
......@@ -66,7 +65,6 @@ describe "Pod::Resolver" do
dependency 'RestKit/Network'
dependency 'RestKit/ObjectMapping'
end
config.rootspec = @podfile
resolver = Pod::Resolver.new(@podfile, stub('sandbox'))
resolver.resolve.values.flatten.map(&:name).sort.should == %w{
LibComponentLogging-Core
......
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