Commit 420fac35 authored by Marc Boquet's avatar Marc Boquet

[PathList] Normalize @root to avoid issues with UTF8 paths

parent 20bb1ea3
require 'active_support/multibyte/unicode'
module Pod module Pod
class Sandbox class Sandbox
# The PathList class is designed to perform multiple glob matches against # The PathList class is designed to perform multiple glob matches against
...@@ -20,7 +22,8 @@ module Pod ...@@ -20,7 +22,8 @@ module Pod
# @param [Pathname] root The root of the PathList. # @param [Pathname] root The root of the PathList.
# #
def initialize(root) def initialize(root)
@root = root root_dir = ActiveSupport::Multibyte::Unicode.normalize(root.to_s)
@root = Pathname.new(root_dir)
@glob_cache = {} @glob_cache = {}
end end
......
...@@ -178,6 +178,13 @@ module Pod ...@@ -178,6 +178,13 @@ module Pod
path_list = Sandbox::PathList.new(fixture('banana-lib')) path_list = Sandbox::PathList.new(fixture('banana-lib'))
path_list.files.should == %w(Classes/NSFetchedResultsController+Banana.h Classes/NSFetchRequest+Banana.h) path_list.files.should == %w(Classes/NSFetchedResultsController+Banana.h Classes/NSFetchRequest+Banana.h)
end end
it 'supports unicode paths' do
# Load fixture("ü") with chars ["u", "̈"] instead of ["ü"]
unicode_name = [117, 776].pack('U*')
path_list = Sandbox::PathList.new(fixture(unicode_name))
path_list.files.should == ['README']
end
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