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
610652c4
Commit
610652c4
authored
Jul 19, 2017
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure source urls are set when spec has subspecs with dependencies
parent
b20dcecb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
CHANGELOG.md
CHANGELOG.md
+3
-2
validator.rb
lib/cocoapods/validator.rb
+1
-1
validator_spec.rb
spec/unit/validator_spec.rb
+23
-1
No files found.
CHANGELOG.md
View file @
610652c4
...
@@ -12,8 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -12,8 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
None.
*
Ensure source urls are set when spec has subspecs with dependencies
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#6888
](
https://github.com/CocoaPods/CocoaPods/pull/6888
)
## 1.3.0.beta.3 (2017-07-19)
## 1.3.0.beta.3 (2017-07-19)
...
...
lib/cocoapods/validator.rb
View file @
610652c4
...
@@ -29,7 +29,7 @@ module Pod
...
@@ -29,7 +29,7 @@ module Pod
#
#
def
initialize
(
spec_or_path
,
source_urls
)
def
initialize
(
spec_or_path
,
source_urls
)
@linter
=
Specification
::
Linter
.
new
(
spec_or_path
)
@linter
=
Specification
::
Linter
.
new
(
spec_or_path
)
@source_urls
=
if
@linter
.
spec
&&
@linter
.
spec
.
dependencies
.
empty?
@source_urls
=
if
@linter
.
spec
&&
@linter
.
spec
.
dependencies
.
empty?
&&
@linter
.
spec
.
recursive_subspecs
.
all?
{
|
s
|
s
.
dependencies
.
empty?
}
[]
[]
else
else
source_urls
.
map
{
|
url
|
config
.
sources_manager
.
source_with_name_or_url
(
url
)
}.
map
(
&
:url
)
source_urls
.
map
{
|
url
|
config
.
sources_manager
.
source_with_name_or_url
(
url
)
}.
map
(
&
:url
)
...
...
spec/unit/validator_spec.rb
View file @
610652c4
...
@@ -381,7 +381,7 @@ module Pod
...
@@ -381,7 +381,7 @@ module Pod
podfile
.
sources
.
should
==
%w()
podfile
.
sources
.
should
==
%w()
end
end
it
'repects the source_urls parameter when there are dependencies'
do
it
're
s
pects the source_urls parameter when there are dependencies'
do
podspec
=
stub_podspec
(
/.*name.*/
,
'"name": "SBJson",'
).
gsub
(
/.*version.*/
,
'"version": "3.2",'
)
podspec
=
stub_podspec
(
/.*name.*/
,
'"name": "SBJson",'
).
gsub
(
/.*version.*/
,
'"version": "3.2",'
)
file
=
write_podspec
(
podspec
,
'SBJson.podspec.json'
)
file
=
write_podspec
(
podspec
,
'SBJson.podspec.json'
)
spec
=
Specification
.
from_file
(
file
)
spec
=
Specification
.
from_file
(
file
)
...
@@ -403,6 +403,28 @@ module Pod
...
@@ -403,6 +403,28 @@ module Pod
podfile
.
sources
.
should
==
%w(https://github.com/CocoaPods/Specs.git)
podfile
.
sources
.
should
==
%w(https://github.com/CocoaPods/Specs.git)
end
end
it
'respects the source_urls parameter when there are dependencies within subspecs'
do
podspec
=
stub_podspec
(
/.*name.*/
,
'"name": "SBJson",'
).
gsub
(
/.*version.*/
,
'"version": "3.2",'
)
file
=
write_podspec
(
podspec
,
'SBJson.podspec.json'
)
spec
=
Specification
.
from_file
(
file
)
set
=
mock
set
.
stubs
(
:all_specifications
).
returns
([
spec
])
Source
::
Aggregate
.
any_instance
.
stubs
(
:search
).
with
(
Dependency
.
new
(
'SBJson'
,
'~> 3.2'
)).
returns
(
set
)
podspec
=
stub_podspec
(
/.*name.*/
,
'"name": "ZKit",'
)
podspec
.
gsub!
(
/.*requires_arc.*/
,
'"subspecs": [ { "name":"SubSpecA", "dependencies": { "SBJson": [ "~> 3.2" ] } } ], "requires_arc": false'
)
file
=
write_podspec
(
podspec
,
'ZKit.podspec.json'
)
spec
=
Specification
.
from_file
(
file
)
sources
=
%w(master https://github.com/CocoaPods/Specs.git)
Command
::
Repo
::
Add
.
any_instance
.
stubs
(
:run
)
validator
=
Validator
.
new
(
spec
,
sources
)
validator
.
stubs
(
:validate_url
)
podfile
=
validator
.
send
(
:podfile_from_spec
,
:ios
,
'5.0'
)
podfile
.
sources
.
should
==
%w(https://github.com/CocoaPods/Specs.git)
end
it
'avoids creation of sources when no dependencies'
do
it
'avoids creation of sources when no dependencies'
do
sources
=
%w(master https://github.com/CocoaPods/Specs.git)
sources
=
%w(master https://github.com/CocoaPods/Specs.git)
config
.
sources_manager
.
expects
(
:find_or_create_source_with_url
).
never
config
.
sources_manager
.
expects
(
:find_or_create_source_with_url
).
never
...
...
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