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
05e55074
Commit
05e55074
authored
Sep 16, 2014
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UI] Use CLAide for wrapping
Closes
https://github.com/CocoaPods/CocoaPods/issues/2333
parent
2b3d0532
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
user_interface.rb
lib/cocoapods/user_interface.rb
+11
-10
No files found.
lib/cocoapods/user_interface.rb
View file @
05e55074
...
@@ -119,7 +119,7 @@ module Pod
...
@@ -119,7 +119,7 @@ module Pod
#
#
def
info
(
message
)
def
info
(
message
)
indentation
=
config
.
verbose?
?
self
.
indentation_level
:
0
indentation
=
config
.
verbose?
?
self
.
indentation_level
:
0
indented
=
wrap_string
(
message
,
' '
*
indentation
)
indented
=
wrap_string
(
message
,
indentation
)
puts
(
indented
)
puts
(
indented
)
self
.
indentation_level
+=
2
self
.
indentation_level
+=
2
...
@@ -209,7 +209,7 @@ module Pod
...
@@ -209,7 +209,7 @@ module Pod
# wrapping it to the terminal width if necessary.
# wrapping it to the terminal width if necessary.
#
#
def
puts_indented
(
message
=
''
)
def
puts_indented
(
message
=
''
)
indented
=
wrap_string
(
message
,
' '
*
self
.
indentation_level
)
indented
=
wrap_string
(
message
,
self
.
indentation_level
)
puts
(
indented
)
puts
(
indented
)
end
end
...
@@ -224,8 +224,9 @@ module Pod
...
@@ -224,8 +224,9 @@ module Pod
next
if
warning
[
:verbose_only
]
&&
!
config
.
verbose?
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
,
' - '
)
string
=
"-
#{
action
}
"
puts
(
indented
)
string
=
wrap_string
(
string
,
4
)
puts
(
string
)
end
end
end
end
end
end
...
@@ -283,13 +284,13 @@ module Pod
...
@@ -283,13 +284,13 @@ module Pod
# @note If CocoaPods is not being run in a terminal or the width of the
# @note If CocoaPods is not being run in a terminal or the width of the
# terminal is too small a width of 80 is assumed.
# terminal is too small a width of 80 is assumed.
#
#
def
wrap_string
(
txt
,
indent
=
''
)
def
wrap_string
(
string
,
indent
=
0
)
if
disable_wrap
||
!
STDIN
.
tty?
if
disable_wrap
txt
string
else
else
width
=
`stty size`
.
split
(
' '
)[
1
].
to_i
-
indent
.
length
first_space
=
' '
*
indent
width
=
80
unless
width
>=
10
indented
=
CLAide
::
Helper
.
wrap_with_indent
(
string
,
indent
,
9999
)
txt
.
strip
.
gsub
(
/(.{1,
#{
width
}
})( +|$)\n?|(.{
#{
width
}
})/
,
indent
+
"
\\
1
\\
3
\n
"
)
first_space
+
indented
end
end
end
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