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
290eca16
Commit
290eca16
authored
Oct 27, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4322 from CocoaPods/seg-podspec-finder-no-recurse
[PodspecFinder] Only consider toplevel podspecs
parents
17fcb6d3
7ce687b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
1 deletion
+54
-1
CHANGELOG.md
CHANGELOG.md
+5
-0
podspec_finder.rb
lib/cocoapods/sandbox/podspec_finder.rb
+1
-1
podspec_finder_spec.rb
spec/unit/sandbox/podspec_finder_spec.rb
+48
-0
No files found.
CHANGELOG.md
View file @
290eca16
...
...
@@ -68,6 +68,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
#3644
](
https://github.com/CocoaPods/CocoaPods/issues/3644
)
[
#4393
](
https://github.com/CocoaPods/CocoaPods/issues/4393
)
*
Only the root directory of externally-sourced pods will be searched for
podspecs.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#3683
](
https://github.com/CocoaPods/CocoaPods/issues/3683
)
## 0.39.0 (2015-10-09)
...
...
lib/cocoapods/sandbox/podspec_finder.rb
View file @
290eca16
...
...
@@ -10,7 +10,7 @@ module Pod
def
podspecs
return
@specs_by_name
if
@specs_by_name
@specs_by_name
=
{}
spec_files
=
Pathname
.
glob
(
root
+
'{,*
,*/*
}.podspec{,.json}'
)
spec_files
=
Pathname
.
glob
(
root
+
'{,*}.podspec{,.json}'
)
spec_files
.
sort_by
{
|
p
|
-
p
.
to_path
.
split
(
File
::
SEPARATOR
).
size
}.
each
do
|
file
|
begin
spec
=
Specification
.
from_file
(
file
)
...
...
spec/unit/sandbox/podspec_finder_spec.rb
0 → 100644
View file @
290eca16
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
module
Pod
describe
Sandbox
::
PodspecFinder
do
before
do
@root
=
Pathname
(
Dir
.
mktmpdir
)
@finder
=
Sandbox
::
PodspecFinder
.
new
(
@root
)
end
after
do
@root
.
rmtree
end
it
'returns an empty hash when no podspecs are found'
do
@finder
.
podspecs
.
should
.
be
.
empty
end
it
"warns when a found podspec can't be parsed"
do
@root
.
+
(
'RestKit.podspec.json'
).
open
(
'w'
)
{
|
f
|
f
<<
'{]'
}
@finder
.
podspecs
.
should
.
be
.
empty
UI
.
warnings
.
should
.
include
"Unable to load a podspec from `RestKit.podspec.json`, skipping:
\n\n
"
end
it
'ignores podspecs not in the root'
do
path
=
@root
+
'Dir/RestKit.podspec.json'
path
.
parent
.
mkpath
path
.
open
(
'w'
)
{
|
f
|
f
<<
'{"name":"RestKit"}'
}
@finder
.
podspecs
.
should
.
be
.
empty
end
it
'groups found podspecs by name'
do
@root
.
+
(
'Realm.podspec.json'
).
open
(
'w'
)
{
|
f
|
f
<<
'{"name":"Realm"}'
}
@root
.
+
(
'RealmSwift.podspec'
).
open
(
'w'
)
{
|
f
|
f
<<
'Pod::Specification.new { |s| s.name = "RealmSwift" }'
}
@finder
.
podspecs
.
should
==
{
'Realm'
=>
Pod
::
Specification
.
new
{
|
s
|
s
.
name
=
'Realm'
},
'RealmSwift'
=>
Pod
::
Specification
.
new
{
|
s
|
s
.
name
=
'RealmSwift'
},
}
end
it
'caches the podspecs'
do
@finder
.
podspecs
Pathname
.
expects
(
:glob
).
never
@finder
.
podspecs
end
end
end
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