Commit 538b2d2e authored by Samuel E. Giddins's avatar Samuel E. Giddins

[PodspecFinder] Use pathname for globbing

parent d0dc2b81
...@@ -10,13 +10,13 @@ module Pod ...@@ -10,13 +10,13 @@ module Pod
def podspecs def podspecs
return @specs_by_name if @specs_by_name return @specs_by_name if @specs_by_name
@specs_by_name = {} @specs_by_name = {}
spec_files = Dir.glob(root + '{,*,*/*}.podspec{,.json}') spec_files = Pathname.glob(root + '{,*,*/*}.podspec{,.json}')
spec_files.sort_by { |p| -p.split(File::SEPARATOR).size }.each do |file| spec_files.sort_by { |p| -p.to_path.split(File::SEPARATOR).size }.each do |file|
begin begin
spec = Specification.from_file(file) spec = Specification.from_file(file)
@specs_by_name[spec.name] = spec @specs_by_name[spec.name] = spec
rescue => e rescue => e
UI.warn "Unable to load a podspec from #{file}, skipping:\n\n#{e}" UI.warn "Unable to load a podspec from `#{file.basename}`, skipping:\n\n#{e}"
end end
end end
@specs_by_name @specs_by_name
......
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