Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
8e72cbe1
Commit
8e72cbe1
authored
Oct 04, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[LocalPod] Fixed clean paths.
Closes #519 Closes #568
parent
4b349723
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
CHANGELOG.md
CHANGELOG.md
+4
-0
local_pod.rb
lib/cocoapods/local_pod.rb
+5
-3
local_pod_spec.rb
spec/unit/local_pod_spec.rb
+5
-4
No files found.
CHANGELOG.md
View file @
8e72cbe1
...
...
@@ -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
)
...
...
lib/cocoapods/local_pod.rb
View file @
8e72cbe1
...
...
@@ -163,12 +163,14 @@ module Pod
#
# @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
...
...
spec/unit/local_pod_spec.rb
View file @
8e72cbe1
...
...
@@ -56,11 +56,11 @@ describe Pod::LocalPod do
end
it
"returns an expanded list the files to clean"
do
clean_paths
=
@pod
.
clean_paths
.
map
{
|
p
|
p
.
to_s
.
gsub
(
/.*
Pods\/BananaL
ib/
,
''
)
}
clean_paths
=
@pod
.
clean_paths
.
map
{
|
p
|
p
.
to_s
.
gsub
(
/.*
pods\/bananal
ib/
,
''
)
}
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?
(
'lib
P
usher'
)
}
clean_files_without_hidden
=
clean_paths
.
reject
{
|
p
|
p
.
to_s
.
include?
(
'/.'
)
||
p
.
to_s
.
include?
(
'lib
p
usher'
)
}
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 @@ describe Pod::LocalPod do
/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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment