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
cc2826bf
Commit
cc2826bf
authored
Jun 24, 2013
by
Eloy Durán
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1130 from HBehrens/master
fix for erroneous linting on 0.21.0.rc1
parents
2fa29fb1
62ddb8e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
validator.rb
lib/cocoapods/validator.rb
+5
-2
validator_spec.rb
spec/unit/validator_spec.rb
+14
-1
No files found.
lib/cocoapods/validator.rb
View file @
cc2826bf
...
@@ -208,8 +208,11 @@ module Pod
...
@@ -208,8 +208,11 @@ module Pod
installer
=
Installer
.
new
(
sandbox
,
podfile
)
installer
=
Installer
.
new
(
sandbox
,
podfile
)
installer
.
install!
installer
.
install!
file_accessors
=
installer
.
aggregate_targets
.
first
.
pod_targets
.
first
.
file_accessors
file_accessors
=
installer
.
aggregate_targets
.
map
do
|
target
|
@file_accessor
=
file_accessors
.
find
{
|
accessor
|
accessor
.
spec
==
spec
}
target
.
pod_targets
.
map
(
&
:file_accessors
)
end
.
flatten
@file_accessor
=
file_accessors
.
find
{
|
accessor
|
accessor
.
spec
.
root
.
name
==
spec
.
root
.
name
}
config
.
silent
config
.
silent
end
end
...
...
spec/unit/validator_spec.rb
View file @
cc2826bf
...
@@ -6,7 +6,7 @@ module Pod
...
@@ -6,7 +6,7 @@ module Pod
# @return [void]
# @return [void]
#
#
def
write_podspec
(
text
,
name
=
'JSONKit.podspec'
)
def
write_podspec
(
text
,
name
=
'JSONKit.podspec'
)
file
=
temporary_directory
+
'JSONKit.podspec'
file
=
temporary_directory
+
name
File
.
open
(
file
,
'w'
)
{
|
f
|
f
.
write
(
text
)
}
File
.
open
(
file
,
'w'
)
{
|
f
|
f
.
write
(
text
)
}
file
file
end
end
...
@@ -64,6 +64,19 @@ module Pod
...
@@ -64,6 +64,19 @@ module Pod
validator
.
results
.
map
(
&
:to_s
).
first
.
should
.
match
/source_files.*did not match/
validator
.
results
.
map
(
&
:to_s
).
first
.
should
.
match
/source_files.*did not match/
validator
.
result_type
.
should
==
:error
validator
.
result_type
.
should
==
:error
end
end
it
"validates a podspec with dependencies"
do
podspec
=
stub_podspec
(
/s.name.*$/
,
's.name = "ZKit"'
)
podspec
.
gsub!
(
/s.requires_arc/
,
"s.dependency 'SBJson', '~> 3.2'
\n
s.requires_arc"
)
podspec
.
gsub!
(
/s.license.*$/
,
's.license = "Public Domain"'
)
file
=
write_podspec
(
podspec
,
"ZKit.podspec"
)
spec
=
Specification
.
from_file
(
file
)
validator
=
Validator
.
new
(
spec
)
validator
.
validate
validator
.
results
.
should
.
be
.
empty
validator
.
validated?
.
should
.
be
.
true
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