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
84f9bd51
Commit
84f9bd51
authored
Apr 10, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[cleanup] Pod::Command::Presenter
parent
6ae76658
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
presenter.rb
lib/cocoapods/command/presenter.rb
+8
-13
No files found.
lib/cocoapods/command/presenter.rb
View file @
84f9bd51
require
'net/http'
module
Pod
module
Pod
class
Command
class
Command
class
Presenter
class
Presenter
...
@@ -18,28 +16,25 @@ module Pod
...
@@ -18,28 +16,25 @@ module Pod
def
present_set
(
set
)
def
present_set
(
set
)
puts
"-->
#{
set
.
name
}
(
#{
set
.
versions
.
reverse
.
join
(
", "
)
}
)"
.
green
puts
"-->
#{
set
.
name
}
(
#{
set
.
versions
.
reverse
.
join
(
", "
)
}
)"
.
green
puts
_wrapped_text
(
set
.
summary
)
puts
wrap_string
(
set
.
summary
)
spec
=
set
.
specification
.
part_of_other_pod?
?
set
.
specification
.
part_of_specification
:
set
.
specification
spec
=
set
.
specification
.
part_of_other_pod?
?
set
.
specification
.
part_of_specification
:
set
.
specification
puts_detail
(
'Homepage'
,
spec
.
homepage
)
puts_detail
(
'Homepage'
,
spec
.
homepage
)
puts_detail
(
'Source'
,
spec
.
source_url
)
puts_detail
(
'Source'
,
spec
.
source_url
)
if
@stats
puts_detail
(
'Watchers'
,
spec
.
github_watchers
)
if
@stats
puts_detail
(
'Watchers'
,
spec
.
github_watchers
)
puts_detail
(
'Forks'
,
spec
.
github_forks
)
if
@stats
puts_detail
(
'Forks'
,
spec
.
github_forks
)
end
puts
puts
end
end
# adapted from http://blog.macromates.com/2006/wrapping-text-with-regular-expressions/
# adapted from http://blog.macromates.com/2006/wrapping-text-with-regular-expressions/
def
puts_wrapped_text
(
txt
,
col
=
80
,
indentation
=
4
)
def
wrap_string
(
txt
,
col
=
80
,
indentation
=
4
)
indent
=
' '
*
indentation
indent
=
' '
*
indentation
puts
txt
.
strip
.
gsub
(
/(.{1,
#{
col
}
})( +|$)\n?|(.{
#{
col
}
})/
,
indent
+
"
\\
1
\\
3
\n
"
)
txt
.
strip
.
gsub
(
/(.{1,
#{
col
}
})( +|$)\n?|(.{
#{
col
}
})/
,
indent
+
"
\\
1
\\
3
\n
"
)
end
end
def
puts_detail
(
title
,
string
)
def
puts_detail
(
title
,
string
,
preferred_indentation
=
8
)
# 8 is the length of Homepage
return
if
!
string
return
if
!
string
# 8 is the length of homepage
number_of_spaces
=
((
preferred_indentation
-
title
.
length
)
>
0
)
?
(
preferred_indentation
-
title
.
length
)
:
0
number_of_spaces
=
((
8
-
title
.
length
)
>
0
)
?
(
8
-
title
.
length
)
:
0
spaces
=
' '
*
number_of_spaces
spaces
=
' '
*
number_of_spaces
puts
" -
#{
title
}
:
#{
spaces
+
string
}
"
puts
" -
#{
title
}
:
#{
spaces
+
string
}
"
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