Commit acc85d87 authored by Fabio Pelosin's avatar Fabio Pelosin

[Sandbox] Added #relativize_paths.

parent bd2297c1
...@@ -103,6 +103,14 @@ module Pod ...@@ -103,6 +103,14 @@ module Pod
result result
end end
# Converts a list of paths to their relative variant.
#
# @return [Array<Pathname>] the relative paths.
#
def relativize_paths(paths)
paths.map { |path| relativize(path) }
end
# @return [String] a string representation suitable for debugging. # @return [String] a string representation suitable for debugging.
# #
def inspect def inspect
......
...@@ -51,6 +51,11 @@ module Pod ...@@ -51,6 +51,11 @@ module Pod
@sandbox.relativize(path).should == expected @sandbox.relativize(path).should == expected
end end
it "converts a list of paths to the relative paths respec to the sandbox" do
paths = [temporary_directory + 'Sandbox/file_1', temporary_directory + 'Sandbox/file_2' ]
@sandbox.relativize_paths(paths).should == [Pathname.new('file_1'), Pathname.new('file_2')]
end
#--------------------------------------# #--------------------------------------#
it "returns the path of the manifest" do it "returns the path of the manifest" 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