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
76a401c0
Commit
76a401c0
authored
Oct 30, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4314 from CocoaPods/seg-validator-subspec-name
[Validator] Allow specifying only the subspec name
parents
187ce57c
71d3acba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
1 deletion
+36
-1
CHANGELOG.md
CHANGELOG.md
+4
-0
validator.rb
lib/cocoapods/validator.rb
+2
-1
validator_spec.rb
spec/unit/validator_spec.rb
+30
-0
No files found.
CHANGELOG.md
View file @
76a401c0
...
...
@@ -87,6 +87,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Andrea Cremaschi
](
https://github.com/andreacremaschi
)
[
#4468
](
https://github.com/CocoaPods/CocoaPods/issues/4468
)
*
Specifying relative subspec names to the linter is now supported.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#1917
](
https://github.com/CocoaPods/CocoaPods/issues/1917
)
## 0.39.0 (2015-10-09)
...
...
lib/cocoapods/validator.rb
View file @
76a401c0
...
...
@@ -67,7 +67,8 @@ module Pod
# Replace default spec with a subspec if asked for
a_spec
=
spec
if
spec
&&
@only_subspec
a_spec
=
spec
.
subspec_by_name
(
@only_subspec
)
subspec_name
=
@only_subspec
.
start_with?
(
spec
.
root
.
name
)
?
@only_subspec
:
"
#{
spec
.
root
.
name
}
/
#{
@only_subspec
}
"
a_spec
=
spec
.
subspec_by_name
(
subspec_name
)
@subspec_name
=
a_spec
.
name
end
...
...
spec/unit/validator_spec.rb
View file @
76a401c0
...
...
@@ -91,6 +91,36 @@ module Pod
validator
.
validate
validator
.
validation_dir
.
should
.
be
==
Pathname
.
new
(
Dir
.
tmpdir
)
+
'CocoaPods/Lint'
end
describe
'#only_subspec'
do
before
do
podspec
=
fixture
(
'spec-repos'
)
+
'master/Specs/RestKit/0.22.0/RestKit.podspec.json'
@validator
=
Validator
.
new
(
podspec
,
SourcesManager
.
master
.
map
(
&
:url
))
@validator
.
quick
=
true
end
it
'handles a relative subspec name'
do
@validator
.
only_subspec
=
'CoreData'
@validator
.
validate
@validator
.
send
(
:subspec_name
).
should
==
'RestKit/CoreData'
end
it
'handles an absolute subspec name'
do
@validator
.
only_subspec
=
'RestKit/CoreData'
@validator
.
validate
@validator
.
send
(
:subspec_name
).
should
==
'RestKit/CoreData'
end
it
'handles a missing subspec name'
do
@validator
.
only_subspec
=
'RestKit/Missing'
should
.
raise
(
Informative
)
{
@validator
.
validate
}.
message
.
should
.
include
'Unable to find a specification named `RestKit/Missing`'
@validator
.
only_subspec
=
'Missing'
should
.
raise
(
Informative
)
{
@validator
.
validate
}.
message
.
should
.
include
'Unable to find a specification named `RestKit/Missing`'
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