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
21e60f91
Commit
21e60f91
authored
Dec 18, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PathList] Fix for Ruby 2.0.0-preview2.
parent
71983133
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
path_list.rb
lib/cocoapods/local_pod/path_list.rb
+4
-6
path_list_spec.rb
spec/unit/local_pod/path_list_spec.rb
+9
-4
No files found.
lib/cocoapods/local_pod/path_list.rb
View file @
21e60f91
...
@@ -42,17 +42,15 @@ module Pod
...
@@ -42,17 +42,15 @@ module Pod
# @return [void] Reads the file system and populates the files and paths
# @return [void] Reads the file system and populates the files and paths
# lists.
# lists.
#
#
# @todo Ruby 2.0 developer preview 1 does not returns directories
# ending with '/.' and '/..'.
#
def
read_file_system
def
read_file_system
root_length
=
root
.
to_s
.
length
+
1
root_length
=
root
.
to_s
.
length
+
1
paths
=
Dir
.
glob
(
root
+
"**/*"
,
File
::
FNM_DOTMATCH
)
paths
=
Dir
.
glob
(
root
+
"**/*"
,
File
::
FNM_DOTMATCH
)
dirs
=
paths
.
select
{
|
path
|
File
.
directory?
(
path
)
}
dirs
=
dirs
.
map
{
|
p
|
p
[
root_length
..-
1
]
}
paths
=
paths
.
map
{
|
p
|
p
[
root_length
..-
1
]
}
paths
=
paths
.
map
{
|
p
|
p
[
root_length
..-
1
]
}
paths
=
paths
.
reject
{
|
p
|
p
==
'.'
||
p
==
'..'
}
paths
=
paths
.
reject
{
|
p
|
p
==
'.'
||
p
==
'..'
}
dirs_entries
=
paths
.
select
{
|
path
|
path
.
end_with?
(
'/.'
,
'/..'
)
}
@files
=
paths
-
dirs
@files
=
paths
-
dirs_entries
@dirs
=
dirs
.
map
{
|
d
|
d
.
gsub
(
/\/\.\.?$/
,
''
)
}.
uniq
@dirs
=
dirs_entries
.
map
{
|
d
|
d
.
gsub
(
/\/\.\.?$/
,
''
)
}.
uniq
end
end
# @return [Array<Pathname>] Similar to {glob} but returns the absolute
# @return [Array<Pathname>] Similar to {glob} but returns the absolute
...
...
spec/unit/local_pod/path_list_spec.rb
View file @
21e60f91
...
@@ -11,12 +11,17 @@ describe Pod::LocalPod::PathList do
...
@@ -11,12 +11,17 @@ describe Pod::LocalPod::PathList do
files
.
reject!
do
|
f
|
files
.
reject!
do
|
f
|
f
.
include?
(
'libPusher'
)
||
f
.
include?
(
'.git'
)
||
f
.
include?
(
'DS_Store'
)
f
.
include?
(
'libPusher'
)
||
f
.
include?
(
'.git'
)
||
f
.
include?
(
'DS_Store'
)
end
end
files
.
sort
.
should
==
%w|
expected
=
%w[
BananaLib.podspec
BananaLib.podspec
Classes Classes/Banana.h Classes/Banana.m Classes/BananaLib.pch
Classes/Banana.h
Classes/Banana.m
Classes/BananaLib.pch
README
README
Resources Resources/logo-sidebar.png
Resources/logo-sidebar.png
sub-dir sub-dir/sub-dir-2 sub-dir/sub-dir-2/somefile.txt |
sub-dir/sub-dir-2/somefile.txt
]
files
.
sort
.
should
==
expected
end
end
it
"creates theh list of the directories"
do
it
"creates theh list of the directories"
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