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
9fb296b5
Commit
9fb296b5
authored
Feb 27, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UI] Fix output color & warning crash
parent
bcb2d607
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
command.rb
lib/cocoapods/command.rb
+10
-3
user_interface.rb
lib/cocoapods/user_interface.rb
+2
-2
No files found.
lib/cocoapods/command.rb
View file @
9fb296b5
...
@@ -52,11 +52,18 @@ module Pod
...
@@ -52,11 +52,18 @@ module Pod
#
#
# @todo We should probably not even load colored unless needed.
# @todo We should probably not even load colored unless needed.
#
#
# @todo Move silent flag to CLAide.
#
# @note It is importat that the commadnds don't overide the default
# settings if their flag is missing (i.e. their value is nil)
#
def
initialize
(
argv
)
def
initialize
(
argv
)
config
.
silent
=
argv
.
flag?
(
'silent'
,
config
.
silent
)
config
.
verbose
=
argv
.
flag?
(
'verbose'
,
config
.
verbose?
)
String
.
send
(
:define_method
,
:colorize
)
{
|
string
,
_
|
string
}
unless
self
.
colorize_output?
super
super
config
.
silent
=
argv
.
flag?
(
'silent'
,
config
.
silent
)
config
.
verbose
=
self
.
verbose?
unless
self
.
verbose
.
nil?
unless
self
.
colorize_output?
String
.
send
(
:define_method
,
:colorize
)
{
|
string
,
_
|
string
}
end
end
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
...
...
lib/cocoapods/user_interface.rb
View file @
9fb296b5
...
@@ -145,7 +145,7 @@ module Pod
...
@@ -145,7 +145,7 @@ module Pod
# return [void]
# return [void]
#
#
def
warn
(
message
,
actions
=
[],
verbose_only
=
false
)
def
warn
(
message
,
actions
=
[],
verbose_only
=
false
)
warnings
<<
{
:message
=>
message
,
:actions
=>
actions
}
warnings
<<
{
:message
=>
message
,
:actions
=>
actions
,
:verbose_only
=>
verbose_only
}
end
end
# Prints the stored warnings. This method is intended to be called at the
# Prints the stored warnings. This method is intended to be called at the
...
@@ -154,9 +154,9 @@ module Pod
...
@@ -154,9 +154,9 @@ module Pod
# @return [void]
# @return [void]
#
#
def
print_warnings
def
print_warnings
return
if
config
.
silent?
&&
verbose_only
STDOUT
.
flush
STDOUT
.
flush
warnings
.
each
do
|
warning
|
warnings
.
each
do
|
warning
|
next
if
warning
[
:verbose_only
]
&&
!
config
.
verbose?
STDERR
.
puts
(
"
\n
[!]
#{
warning
[
:message
]
}
"
.
yellow
)
STDERR
.
puts
(
"
\n
[!]
#{
warning
[
:message
]
}
"
.
yellow
)
warning
[
:actions
].
each
do
|
action
|
warning
[
:actions
].
each
do
|
action
|
indented
=
wrap_string
(
action
,
" - "
)
indented
=
wrap_string
(
action
,
" - "
)
...
...
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