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
1b5a8458
Commit
1b5a8458
authored
Feb 21, 2012
by
Chris Eidhof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display a more helpful message when pod spec lint validates.
parent
adcb74d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
spec.rb
lib/cocoapods/command/spec.rb
+1
-1
specification.rb
lib/cocoapods/specification.rb
+5
-1
No files found.
lib/cocoapods/command/spec.rb
View file @
1b5a8458
...
@@ -120,7 +120,7 @@ module Pod
...
@@ -120,7 +120,7 @@ module Pod
def
lint
def
lint
file
=
@name
?
Pathname
.
new
(
@name
)
:
Pathname
.
pwd
.
glob
(
'*.podspec'
).
first
file
=
@name
?
Pathname
.
new
(
@name
)
:
Pathname
.
pwd
.
glob
(
'*.podspec'
).
first
spec
=
Specification
.
from_file
(
file
)
spec
=
Specification
.
from_file
(
file
)
spec
.
validate!
puts
"This pod specification contains all required attributes."
if
spec
.
validate!
end
end
end
end
end
end
...
...
lib/cocoapods/specification.rb
View file @
1b5a8458
...
@@ -337,12 +337,16 @@ module Pod
...
@@ -337,12 +337,16 @@ module Pod
allowed
=
[
nil
,
:ios
,
:osx
]
allowed
=
[
nil
,
:ios
,
:osx
]
incorrect
<<
[
"`platform'"
,
allowed
]
unless
allowed
.
include?
(
platform
.
name
)
incorrect
<<
[
"`platform'"
,
allowed
]
unless
allowed
.
include?
(
platform
.
name
)
unless
missing
.
empty?
&&
incorrect
.
empty?
no_errors_found
=
missing
.
empty?
&&
incorrect
.
empty?
unless
no_errors_found
message
=
"The following
#{
(
missing
+
incorrect
).
size
==
1
?
'attribute is'
:
'attributes are'
}
:
\n
"
message
=
"The following
#{
(
missing
+
incorrect
).
size
==
1
?
'attribute is'
:
'attributes are'
}
:
\n
"
message
<<
"* missing:
#{
missing
.
join
(
", "
)
}
"
unless
missing
.
empty?
message
<<
"* missing:
#{
missing
.
join
(
", "
)
}
"
unless
missing
.
empty?
message
<<
"* incorrect:
#{
incorrect
.
map
{
|
x
|
"
#{
x
[
0
]
}
(
#{
x
[
1
..-
1
]
}
)"
}
.join("
,
")}"
unless
incorrect
.
empty?
message
<<
"* incorrect:
#{
incorrect
.
map
{
|
x
|
"
#{
x
[
0
]
}
(
#{
x
[
1
..-
1
]
}
)"
}
.join("
,
")}"
unless
incorrect
.
empty?
raise
Informative
,
message
raise
Informative
,
message
end
end
no_errors_found
end
end
# This is a convenience method which gets called after all pods have been
# This is a convenience method which gets called after all pods have been
...
...
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