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
b0df1f55
Commit
b0df1f55
authored
Dec 10, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Validator] Minor clean up.
parent
32735dc3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
31 deletions
+23
-31
validator.rb
lib/cocoapods/validator.rb
+23
-31
No files found.
lib/cocoapods/validator.rb
View file @
b0df1f55
...
@@ -80,16 +80,10 @@ module Pod
...
@@ -80,16 +80,10 @@ module Pod
end
end
case
result
.
type
case
result
.
type
when
:error
,
:deprecation
when
:error
then
type
=
"ERROR"
type
=
"ERROR"
when
:warning
then
type
=
"WARN"
when
:warning
when
:note
then
type
=
"NOTE"
type
=
"WARN"
else
raise
"
#{
result
.
type
}
"
end
when
:note
type
=
"NOTE"
else
raise
"
#{
result
.
type
}
"
end
UI
.
puts
" -
#{
type
.
ljust
(
5
)
}
|
#{
platform_message
}#{
result
.
message
}
"
UI
.
puts
" -
#{
type
.
ljust
(
5
)
}
|
#{
platform_message
}#{
result
.
message
}
"
end
end
UI
.
puts
UI
.
puts
...
@@ -99,6 +93,8 @@ module Pod
...
@@ -99,6 +93,8 @@ module Pod
# @!group Configuration
# @!group Configuration
# @return [Boolean] TODO
#
attr_accessor
:disable_ui_output
attr_accessor
:disable_ui_output
# @return [Pathname] whether the validation should be performed against a repo.
# @return [Pathname] whether the validation should be performed against a repo.
...
@@ -106,7 +102,7 @@ module Pod
...
@@ -106,7 +102,7 @@ module Pod
attr_accessor
:repo_path
attr_accessor
:repo_path
# @return [Bool] whether the validation should skip the checks that
# @return [Bool] whether the validation should skip the checks that
# requires the download o
r the build o
f the library.
# requires the download of the library.
#
#
attr_accessor
:quick
attr_accessor
:quick
...
@@ -116,13 +112,14 @@ module Pod
...
@@ -116,13 +112,14 @@ module Pod
attr_accessor
:no_clean
attr_accessor
:no_clean
# @return [Bool] whether the validation should be performed against the root of
# @return [Bool] whether the validation should be performed against the root of
# the podspec instead to its original source. Uses the `:local` option
# the podspec instead to its original source.
# of the Podfile.
#
# @note Uses the `:local` option of the Podfile.
#
#
attr_writer
:local
attr_writer
:local
def
local?
;
@local
;
end
def
local?
;
@local
;
end
#
#
@return [Boolean] TODO
#
#
attr_accessor
:only_errors
attr_accessor
:only_errors
...
@@ -137,9 +134,7 @@ module Pod
...
@@ -137,9 +134,7 @@ module Pod
# @return [Boolean]
# @return [Boolean]
#
#
def
validated?
def
validated?
return
false
if
result_type
==
:error
result_type
!=
:error
&&
(
result_type
!=
:warning
||
only_errors
)
return
false
if
result_type
==
:warning
&&
!
only_errors
return
true
end
end
# @return [Symbol]
# @return [Symbol]
...
@@ -148,21 +143,16 @@ module Pod
...
@@ -148,21 +143,16 @@ module Pod
types
=
results
.
map
(
&
:type
).
uniq
types
=
results
.
map
(
&
:type
).
uniq
if
types
.
include?
(
:error
)
then
:error
if
types
.
include?
(
:error
)
then
:error
elsif
types
.
include?
(
:warning
)
then
:warning
elsif
types
.
include?
(
:warning
)
then
:warning
else
:note
else
:note
end
end
end
end
# @return [Symbol]
# @return [Symbol]
#
#
def
result_color
def
result_color
case
result_type
case
result_type
when
:error
when
:error
then
:red
color
=
:red
when
:warning
then
:yellow
when
:warning
else
:green
end
color
=
:yellow
else
color
=
:green
end
end
end
# @return [Pathname] the temporary directory used by the linter.
# @return [Pathname] the temporary directory used by the linter.
...
@@ -229,8 +219,8 @@ module Pod
...
@@ -229,8 +219,8 @@ module Pod
Config
.
instance
=
@original_config
Config
.
instance
=
@original_config
end
end
# It creates a podfile in memory and builds a library containing
# It creates a podfile in memory and builds a library containing
the pod
#
the pod
for all available platforms with xcodebuild.
# for all available platforms with xcodebuild.
#
#
def
install_pod
def
install_pod
podfile
=
podfile_from_spec
(
current_platform
)
podfile
=
podfile_from_spec
(
current_platform
)
...
@@ -241,12 +231,14 @@ module Pod
...
@@ -241,12 +231,14 @@ module Pod
config
.
silent
config
.
silent
end
end
# Performs platform specific analysis.
# Performs platform specific analysis.
It requires to download the source
#
It requires to download the source
at each iteration
# at each iteration
#
#
# @note
Treat xcodebuild warnings
as notes because the spec maintainer
# @note
Xcode warnings are treaded
as notes because the spec maintainer
# might not be the author of the library
# might not be the author of the library
#
#
# @return [void]
#
def
build_pod
def
build_pod
if
`which xcodebuild`
.
strip
.
empty?
if
`which xcodebuild`
.
strip
.
empty?
UI
.
warn
"Skipping compilation with `xcodebuild' because it can't be found.
\n
"
.
yellow
UI
.
warn
"Skipping compilation with `xcodebuild' because it can't be found.
\n
"
.
yellow
...
...
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