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
e588d2c2
Commit
e588d2c2
authored
Dec 06, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2903 from CocoaPods/seg-delete-statistics
[UI] Adapt to the removal of the Set::Statistics class
parents
7ef32e9e
621a744d
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
97 deletions
+9
-97
Gemfile.lock
Gemfile.lock
+1
-1
list.rb
lib/cocoapods/command/list.rb
+0
-35
search.rb
lib/cocoapods/command/search.rb
+1
-2
config.rb
lib/cocoapods/config.rb
+0
-19
user_interface.rb
lib/cocoapods/user_interface.rb
+5
-6
list_spec.rb
spec/functional/command/list_spec.rb
+0
-15
user_interface_spec.rb
spec/functional/user_interface_spec.rb
+2
-4
config_spec.rb
spec/unit/config_spec.rb
+0
-15
No files found.
Gemfile.lock
View file @
e588d2c2
...
@@ -7,7 +7,7 @@ GIT
...
@@ -7,7 +7,7 @@ GIT
GIT
GIT
remote: https://github.com/CocoaPods/Core.git
remote: https://github.com/CocoaPods/Core.git
revision:
49a91acc2b1b9812352fa3605141215fbcc1e466
revision:
c674fd2cb5249a67f558d0fd73d42275710a11c7
branch: master
branch: master
specs:
specs:
cocoapods-core (0.35.0)
cocoapods-core (0.35.0)
...
...
lib/cocoapods/command/list.rb
View file @
e588d2c2
...
@@ -34,41 +34,6 @@ module Pod
...
@@ -34,41 +34,6 @@ module Pod
end
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
class
New
<
List
self
.
summary
=
'Lists pods introduced in the master spec-repo since the last check'
def
run
update_if_necessary!
days
=
[
1
,
2
,
3
,
5
,
8
]
dates
,
groups
=
{},
{}
days
.
each
{
|
d
|
dates
[
d
]
=
Time
.
now
-
60
*
60
*
24
*
d
}
sets
=
SourcesManager
.
aggregate
.
all_sets
statistics_provider
=
Config
.
instance
.
spec_statistics_provider
creation_dates
=
statistics_provider
.
creation_dates
(
sets
)
sets
.
each
do
|
set
|
set_date
=
creation_dates
[
set
.
name
]
days
.
each
do
|
d
|
if
set_date
>=
dates
[
d
]
groups
[
d
]
=
[]
unless
groups
[
d
]
groups
[
d
]
<<
set
break
end
end
end
days
.
reverse
.
each
do
|
d
|
sets
=
groups
[
d
]
next
unless
sets
UI
.
section
(
"
\n
Pods added in the last
#{
'day'
.
pluralize
(
d
)
}
"
.
yellow
)
do
sorted
=
sets
.
sort_by
{
|
s
|
creation_dates
[
s
.
name
]
}
mode
=
@stats
?
:
stats
:
:name
sorted
.
each
{
|
set
|
UI
.
pod
(
set
,
mode
,
statistics_provider
)
}
end
end
end
end
end
end
end
end
end
end
lib/cocoapods/command/search.rb
View file @
e588d2c2
...
@@ -84,11 +84,10 @@ module Pod
...
@@ -84,11 +84,10 @@ module Pod
sets
.
reject!
{
|
set
|
!
set
.
specification
.
available_platforms
.
map
(
&
:name
).
include?
(
:osx
)
}
sets
.
reject!
{
|
set
|
!
set
.
specification
.
available_platforms
.
map
(
&
:name
).
include?
(
:osx
)
}
end
end
statistics_provider
=
Config
.
instance
.
spec_statistics_provider
sets
.
each
do
|
set
|
sets
.
each
do
|
set
|
begin
begin
if
@stats
if
@stats
UI
.
pod
(
set
,
:stats
,
statistics_provider
)
UI
.
pod
(
set
,
:stats
)
else
else
UI
.
pod
(
set
,
:normal
)
UI
.
pod
(
set
,
:normal
)
end
end
...
...
lib/cocoapods/config.rb
View file @
e588d2c2
...
@@ -225,31 +225,12 @@ module Pod
...
@@ -225,31 +225,12 @@ module Pod
@default_test_podfile_path
||=
templates_dir
+
'Podfile.test'
@default_test_podfile_path
||=
templates_dir
+
'Podfile.test'
end
end
# @return [Pathname] The file to use a cache of the statistics provider.
#
def
statistics_cache_file
cache_root
+
'statistics.yml'
end
# @return [Pathname] The file to use to cache the search data.
# @return [Pathname] The file to use to cache the search data.
#
#
def
search_index_file
def
search_index_file
cache_root
+
'search_index.yaml'
cache_root
+
'search_index.yaml'
end
end
public
#-------------------------------------------------------------------------#
# @!group Dependency Injection
# @return [Specification::Set::Statistics] The statistic provider to use
# for specifications.
#
def
spec_statistics_provider
Specification
::
Set
::
Statistics
.
new
(
statistics_cache_file
)
end
private
private
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
...
...
lib/cocoapods/user_interface.rb
View file @
e588d2c2
...
@@ -156,11 +156,11 @@ module Pod
...
@@ -156,11 +156,11 @@ module Pod
# Prints the textual representation of a given set.
# Prints the textual representation of a given set.
#
#
def
pod
(
set
,
mode
=
:normal
,
statistics_provider
=
nil
)
def
pod
(
set
,
mode
=
:normal
)
if
mode
==
:name_and_version
if
mode
==
:name_and_version
puts_indented
"
#{
set
.
name
}
#{
set
.
versions
.
first
.
version
}
"
puts_indented
"
#{
set
.
name
}
#{
set
.
versions
.
first
.
version
}
"
else
else
pod
=
Specification
::
Set
::
Presenter
.
new
(
set
,
statistics_provider
)
pod
=
Specification
::
Set
::
Presenter
.
new
(
set
)
title
=
"
\n
->
#{
pod
.
name
}
(
#{
pod
.
version
}
)"
title
=
"
\n
->
#{
pod
.
name
}
(
#{
pod
.
version
}
)"
if
pod
.
spec
.
deprecated?
if
pod
.
spec
.
deprecated?
title
+=
"
#{
pod
.
deprecation_description
}
"
title
+=
"
#{
pod
.
deprecation_description
}
"
...
@@ -174,17 +174,16 @@ module Pod
...
@@ -174,17 +174,16 @@ module Pod
puts_indented
"pod '
#{
pod
.
name
}
', '~>
#{
pod
.
version
}
'"
puts_indented
"pod '
#{
pod
.
name
}
', '~>
#{
pod
.
version
}
'"
labeled
(
'Homepage'
,
pod
.
homepage
)
labeled
(
'Homepage'
,
pod
.
homepage
)
labeled
(
'Source'
,
pod
.
source_url
)
labeled
(
'Source'
,
pod
.
source_url
)
labeled
(
'Versions'
,
pod
.
verions_by_source
)
labeled
(
'Versions'
,
pod
.
ver
s
ions_by_source
)
if
mode
==
:stats
if
mode
==
:stats
labeled
(
'Pushed'
,
pod
.
github_last_activity
)
labeled
(
'Authors'
,
pod
.
authors
)
if
pod
.
authors
=~
/,/
labeled
(
'Authors'
,
pod
.
authors
)
if
pod
.
authors
=~
/,/
labeled
(
'Author'
,
pod
.
authors
)
if
pod
.
authors
!~
/,/
labeled
(
'Author'
,
pod
.
authors
)
if
pod
.
authors
!~
/,/
labeled
(
'License'
,
pod
.
license
)
labeled
(
'License'
,
pod
.
license
)
labeled
(
'Platform'
,
pod
.
platform
)
labeled
(
'Platform'
,
pod
.
platform
)
labeled
(
'
Watchers'
,
pod
.
github_watch
ers
)
labeled
(
'
Stars'
,
pod
.
github_stargaz
ers
)
labeled
(
'Forks'
,
pod
.
github_forks
)
labeled
(
'Forks'
,
pod
.
github_forks
)
end
end
labeled
(
'Sub
specs'
,
pod
.
subspecs
)
labeled
(
'Subspecs'
,
pod
.
subspecs
)
end
end
end
end
end
end
...
...
spec/functional/command/list_spec.rb
View file @
e588d2c2
...
@@ -17,21 +17,6 @@ module Pod
...
@@ -17,21 +17,6 @@ module Pod
].
each
{
|
regex
|
out
.
should
=~
regex
}
].
each
{
|
regex
|
out
.
should
=~
regex
}
end
end
it
'returns the new pods'
do
sets
=
SourcesManager
.
aggregate
.
all_sets
jsonkit_set
=
sets
.
find
{
|
s
|
s
.
name
==
'JSONKit'
}
dates
=
{
'BananaLib'
=>
Time
.
now
,
'JSONKit'
=>
Time
.
parse
(
'01/01/1970'
),
'Pod+With+Plus+Signs'
=>
Time
.
parse
(
'01/01/1970'
),
}
Specification
::
Set
::
Statistics
.
any_instance
.
stubs
(
:creation_dates
).
returns
(
dates
)
out
=
run_command
(
'list'
,
'new'
)
out
.
should
.
include
(
'BananaLib'
)
out
.
should
.
not
.
include
(
'JSONKit'
)
out
.
should
.
not
.
include
(
'Pod+With+Plus+Signs'
)
end
it
'presents the known pods with versions'
do
it
'presents the known pods with versions'
do
sets
=
SourcesManager
.
aggregate
.
all_sets
sets
=
SourcesManager
.
aggregate
.
all_sets
jsonkit_set
=
sets
.
find
{
|
s
|
s
.
name
==
'JSONKit'
}
jsonkit_set
=
sets
.
find
{
|
s
|
s
.
name
==
'JSONKit'
}
...
...
spec/functional/user_interface_spec.rb
View file @
e588d2c2
...
@@ -41,17 +41,15 @@ module Pod
...
@@ -41,17 +41,15 @@ module Pod
end
end
it
'presents the stats of a specification set'
do
it
'presents the stats of a specification set'
do
Specification
::
Set
::
Presenter
.
any_instance
.
expects
(
:github_last_activity
).
returns
(
'more than a year ago'
)
Specification
::
Set
::
Presenter
.
any_instance
.
expects
(
:github_stargazers
).
returns
(
'318'
)
Specification
::
Set
::
Presenter
.
any_instance
.
expects
(
:github_watchers
).
returns
(
'318'
)
Specification
::
Set
::
Presenter
.
any_instance
.
expects
(
:github_forks
).
returns
(
'42'
)
Specification
::
Set
::
Presenter
.
any_instance
.
expects
(
:github_forks
).
returns
(
'42'
)
UI
.
pod
(
@set
,
:stats
)
UI
.
pod
(
@set
,
:stats
)
output
=
UI
.
output
output
=
UI
.
output
output
.
should
.
include?
'Author: Robbie Hanson'
output
.
should
.
include?
'Author: Robbie Hanson'
output
.
should
.
include?
'License: BSD'
output
.
should
.
include?
'License: BSD'
output
.
should
.
include?
'Platform: iOS 5.0 - OS X 10.7'
output
.
should
.
include?
'Platform: iOS 5.0 - OS X 10.7'
output
.
should
.
include?
'
Watchers:
318'
output
.
should
.
include?
'
Stars:
318'
output
.
should
.
include?
'Forks: 42'
output
.
should
.
include?
'Forks: 42'
output
.
should
.
include?
'Pushed: more than a year ago'
end
end
it
'should print at least one subspec'
do
it
'should print at least one subspec'
do
...
...
spec/unit/config_spec.rb
View file @
e588d2c2
...
@@ -120,10 +120,6 @@ module Pod
...
@@ -120,10 +120,6 @@ module Pod
end
end
end
end
it
'returns the statistics cache file'
do
@sut
.
statistics_cache_file
.
to_s
.
should
.
end_with?
(
'statistics.yml'
)
end
it
'returns the search index file'
do
it
'returns the search index file'
do
@sut
.
search_index_file
.
to_s
.
should
.
end_with?
(
'search_index.yaml'
)
@sut
.
search_index_file
.
to_s
.
should
.
end_with?
(
'search_index.yaml'
)
end
end
...
@@ -153,17 +149,6 @@ module Pod
...
@@ -153,17 +149,6 @@ module Pod
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
describe
'Dependency Injection'
do
it
'returns the specification statistics provider'
do
stats_provider
=
@sut
.
spec_statistics_provider
stats_provider
.
cache_file
.
should
==
@sut
.
cache_root
+
'statistics.yml'
end
end
#-------------------------------------------------------------------------#
describe
'Private helpers'
do
describe
'Private helpers'
do
it
'returns the path of the user settings file'
do
it
'returns the path of the user settings file'
do
...
...
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