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
3a575c7a
Commit
3a575c7a
authored
Sep 22, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UI] Show the versions of a pod per repo.
Closes #226
parent
b455a333
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
user_interface.rb
lib/cocoapods/user_interface.rb
+2
-2
ui_pod.rb
lib/cocoapods/user_interface/ui_pod.rb
+16
-2
user_interface_spec.rb
spec/functional/user_interface_spec.rb
+7
-0
No files found.
lib/cocoapods/user_interface.rb
View file @
3a575c7a
...
...
@@ -141,11 +141,11 @@ module Pod
puts_indented
set
.
name
else
pod
=
UIPod
.
new
(
set
)
title
(
"
\n
->
#{
pod
.
name
}
(
#{
pod
.
version
}
)"
.
green
,
''
,
3
)
do
title
(
"
\n
->
#{
pod
.
name
}
(
#{
pod
.
version
}
)"
.
green
,
''
,
1
)
do
puts_indented
pod
.
summary
labeled
(
'Homepage'
,
pod
.
homepage
)
labeled
(
'Source'
,
pod
.
source_url
)
labeled
(
'Versions'
,
pod
.
ver
sions
)
unless
set
.
versions
.
count
==
1
labeled
(
'Versions'
,
pod
.
ver
ions_by_source
)
if
mode
==
:stats
labeled
(
'Pushed'
,
pod
.
github_last_activity
)
labeled
(
'Authors'
,
pod
.
authors
)
if
pod
.
authors
=~
/,/
...
...
lib/cocoapods/user_interface/ui_pod.rb
View file @
3a575c7a
...
...
@@ -15,11 +15,25 @@ module Pod
end
def
version
@set
.
versions
.
la
st
@set
.
versions
.
fir
st
end
def
versions
@set
.
versions
.
reverse
.
join
(
", "
)
@set
.
versions
.
sort
.
reverse
end
def
verions_by_source
result
=
[]
@set
.
versions_by_source
.
each
do
|
source
,
versions
|
result
<<
"
#{
versions
.
map
(
&
:to_s
)
*
', '
}
[
#{
source
.
name
}
repo]"
end
result
*
' - '
end
# @return [Array<String>]
#
def
sources
@set
.
sources
.
map
(
&
:name
).
sort
end
# specification information
...
...
spec/functional/user_interface_spec.rb
View file @
3a575c7a
...
...
@@ -20,6 +20,13 @@ describe Pod::UI do
output
.
should
.
include?
'https://github.com/robbiehanson/CocoaLumberjack.git'
end
it
"presents the name, version, description, homepage and source of a specification set"
do
Pod
::
UI
.
pod
(
@set
)
output
=
Pod
::
UI
.
output
.
gsub
(
/\n */
,
''
)
output
.
should
.
include?
'Versions: 1.6, 1.3.3, 1.3.2, 1.3.1, 1.3, 1.2.3, 1.2.2, 1.2.1, 1.2, 1.1, 1.0 [master repo]'
end
it
"presents the stats of a specification set"
do
repo
=
{
"forks"
=>
42
,
"watchers"
=>
318
,
"pushed_at"
=>
"2011-01-26T19:06:43Z"
}
Octokit
.
expects
(
:repo
).
with
(
"robbiehanson/CocoaLumberjack"
).
returns
(
repo
)
...
...
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