Commit 6e40410f authored by Samuel Ford's avatar Samuel Ford

preserve local pod paths specified as absolute or rooted to home

parent d92c6880
...@@ -352,7 +352,8 @@ module Pod ...@@ -352,7 +352,8 @@ module Pod
UI.titled_section("Fetching podspec for `#{name}` #{description}", { :verbose_prefix => "-> " }) do UI.titled_section("Fetching podspec for `#{name}` #{description}", { :verbose_prefix => "-> " }) do
podspec = podspec_path podspec = podspec_path
store_podspec(sandbox, podspec) store_podspec(sandbox, podspec)
sandbox.store_local_path(name, podspec.dirname) path_is_absolute_or_rooted_to_home = declared_path.absolute? || declared_path.to_s.start_with?('~')
sandbox.store_local_path(name, podspec.dirname, path_is_absolute_or_rooted_to_home)
end end
end end
......
...@@ -297,7 +297,8 @@ module Pod ...@@ -297,7 +297,8 @@ module Pod
pod_names.each do |pod_name| pod_names.each do |pod_name|
local = sandbox.local?(pod_name) local = sandbox.local?(pod_name)
path = sandbox.pod_dir(pod_name) path = sandbox.pod_dir(pod_name)
@pods_project.add_pod_group(pod_name, path, local, local) was_absolute = sandbox.local_path_was_absolute?(pod_name)
@pods_project.add_pod_group(pod_name, path, local, was_absolute)
end end
if config.podfile_path if config.podfile_path
......
...@@ -69,6 +69,7 @@ module Pod ...@@ -69,6 +69,7 @@ module Pod
@head_pods = [] @head_pods = []
@checkout_sources = {} @checkout_sources = {}
@development_pods = {} @development_pods = {}
@development_pods_were_absolute = {}
end end
# @return [Lockfile] the manifest which contains the information about the # @return [Lockfile] the manifest which contains the information about the
...@@ -158,7 +159,17 @@ module Pod ...@@ -158,7 +159,17 @@ module Pod
root + root_name root + root_name
end end
end end
# Returns true if the path as originally specified was absolute.
#
# @param [String] name
#
# @return [Bool] true if originally absolute
#
def local_path_was_absolute?(name)
@development_pods_were_absolute[name]
end
# @return [Pathname] the directory where to store the documentation. # @return [Pathname] the directory where to store the documentation.
# #
def documentation_dir def documentation_dir
...@@ -338,11 +349,15 @@ module Pod ...@@ -338,11 +349,15 @@ module Pod
# @param [#to_s] path # @param [#to_s] path
# The local path where the Pod is stored. # The local path where the Pod is stored.
# #
# @param [Bool] was_absolute
# True if the specified local path was absolute.
#
# @return [void] # @return [void]
# #
def store_local_path(name, path) def store_local_path(name, path, was_absolute = false)
root_name = Specification.root_name(name) root_name = Specification.root_name(name)
development_pods[root_name] = path.to_s development_pods[root_name] = path.to_s
@development_pods_were_absolute[root_name] = was_absolute
end end
# @return [Hash{String=>String}] The path of the Pods with a local source # @return [Hash{String=>String}] The path of the Pods with a local source
......
...@@ -257,7 +257,7 @@ module Pod ...@@ -257,7 +257,7 @@ module Pod
@installer.pods_project.class.should == Pod::Project @installer.pods_project.class.should == Pod::Project
end end
it "sets the path of the Pod group to an absolute path if local" do it "preserves Pod paths specified as absolute or rooted to home" do
local_podfile = generate_local_podfile local_podfile = generate_local_podfile
local_installer = Installer.new(config.sandbox, local_podfile) local_installer = Installer.new(config.sandbox, local_podfile)
local_installer.send(:analyze) local_installer.send(:analyze)
......
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