Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[LocalPod] Fixed clean paths.

Closes #519
Closes #568
  • Loading branch information...
commit 8e72cbe16464bb31254bbb8a2bea3dff086bcded 1 parent 4b34972
@fabiopelosin fabiopelosin authored
View
4 CHANGELOG.md
@@ -3,6 +3,10 @@
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.15.0...master)
###### Bug fixes
+
+- Fixed an issue that lead to empty directories for Pods.
+ [#519](https://github.com/CocoaPods/CocoaPods/issues/519)
+ [#568](https://github.com/CocoaPods/CocoaPods/issues/568)
- Fixed a crash related to the RubyGems version informative.
[#570](https://github.com/CocoaPods/CocoaPods/issues/570)
View
8 lib/cocoapods/local_pod.rb
@@ -163,12 +163,14 @@ def clean!
#
# @return [Array<Strings>] The paths that can be deleted.
#
+ # @note The Paths are downcased to prevent issues. See #568.
+ #
def clean_paths
- cached_used_paths = used_files
- files = Dir.glob(root + "**/*", File::FNM_DOTMATCH)
+ used = used_files.map(&:downcase)
+ files = Dir.glob(root + "**/*", File::FNM_DOTMATCH).map(&:downcase)
files.reject! do |candidate|
- candidate.end_with?('.', '..') || cached_used_paths.any? do |path|
+ candidate.end_with?('.', '..') || used.any? do |path|
path.include?(candidate) || candidate.include?(path)
end
end
View
9 spec/unit/local_pod_spec.rb
@@ -56,11 +56,11 @@
end
it "returns an expanded list the files to clean" do
- clean_paths = @pod.clean_paths.map { |p| p.to_s.gsub(/.*Pods\/BananaLib/,'') }
+ clean_paths = @pod.clean_paths.map { |p| p.to_s.gsub(/.*pods\/bananalib/,'') }
clean_paths.should.include "/.git/config"
# * There are some hidden files on Travis
# * The submodule of the repo (libPusher) can be ignore, to reduce noise of this test
- clean_files_without_hidden = clean_paths.reject { |p| p.to_s.include?('/.') || p.to_s.include?('libPusher') }
+ clean_files_without_hidden = clean_paths.reject { |p| p.to_s.include?('/.') || p.to_s.include?('libpusher') }
clean_files_without_hidden.should == %W[ /sub-dir /sub-dir/sub-dir-2 /sub-dir/sub-dir-2/somefile.txt ]
end
@@ -208,8 +208,9 @@ def assert_array_equals(expected, computed)
/StoreKit/StoreKit_Prefix.pch
/UIKit/UIKit_Prefix.pch
]
- computed = @pod.clean_paths.each{ |p| p.gsub!(@pod.root.to_s, '') }
- assert_array_equals(expected, computed)
+ root = @pod.root.to_s.downcase
+ computed = @pod.clean_paths.each{ |p| p.gsub!(root, '') }
+ assert_array_equals(expected.map(&:downcase), computed)
end
it "resolves the used files" do
Please sign in to comment.
Something went wrong with that request. Please try again.