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
cfd10bfb
Commit
cfd10bfb
authored
Mar 14, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PathList] Fix support for patterns ending with a slash.
See #859
parent
3ca4216d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
path_list.rb
lib/cocoapods/sandbox/path_list.rb
+4
-1
path_list_spec.rb
spec/unit/sandbox/path_list_spec.rb
+9
-0
No files found.
lib/cocoapods/sandbox/path_list.rb
View file @
cfd10bfb
...
@@ -95,7 +95,10 @@ module Pod
...
@@ -95,7 +95,10 @@ module Pod
list
=
Array
(
patterns
).
map
do
|
pattern
|
list
=
Array
(
patterns
).
map
do
|
pattern
|
if
pattern
.
is_a?
(
String
)
if
pattern
.
is_a?
(
String
)
pattern
+=
'/'
+
dir_pattern
if
directory?
(
pattern
)
&&
dir_pattern
if
directory?
(
pattern
)
&&
dir_pattern
pattern
+=
'/'
unless
pattern
.
end_with?
(
'/'
)
pattern
+=
dir_pattern
end
expanded_patterns
=
dir_glob_equivalent_patterns
(
pattern
)
expanded_patterns
=
dir_glob_equivalent_patterns
(
pattern
)
full_list
.
select
do
|
path
|
full_list
.
select
do
|
path
|
expanded_patterns
.
any?
do
|
p
|
expanded_patterns
.
any?
do
|
p
|
...
...
spec/unit/sandbox/path_list_spec.rb
View file @
cfd10bfb
...
@@ -80,6 +80,15 @@ module Pod
...
@@ -80,6 +80,15 @@ module Pod
]
]
end
end
it
"handles directories specified with a trailing slash"
do
paths
=
@path_list
.
relative_glob
(
'Classes/'
,
{
:dir_pattern
=>
'*.{h,m}'
}
).
map
(
&
:to_s
)
paths
.
sort
.
should
==
%w[
Classes/Banana.h
Classes/Banana.m
Classes/BananaPrivate.h
]
end
it
"supports an optional list of patterns to exclude"
do
it
"supports an optional list of patterns to exclude"
do
exclude_patterns
=
[
'**/*.m'
,
'**/*Private*.*'
]
exclude_patterns
=
[
'**/*.m'
,
'**/*Private*.*'
]
paths
=
@path_list
.
relative_glob
(
'Classes/*'
,
{
:exclude_patterns
=>
exclude_patterns
}).
map
(
&
:to_s
)
paths
=
@path_list
.
relative_glob
(
'Classes/*'
,
{
:exclude_patterns
=>
exclude_patterns
}).
map
(
&
:to_s
)
...
...
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