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
76a369ae
Commit
76a369ae
authored
Aug 21, 2014
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SourcesManager] Cleanup
parent
6d3821be
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
39 deletions
+8
-39
list.rb
lib/cocoapods/command/list.rb
+2
-2
sources_manager.rb
lib/cocoapods/sources_manager.rb
+4
-31
list_spec.rb
spec/functional/command/list_spec.rb
+2
-2
sources_manager_spec.rb
spec/unit/sources_manager_spec.rb
+0
-4
No files found.
lib/cocoapods/command/list.rb
View file @
76a369ae
...
...
@@ -23,7 +23,7 @@ module Pod
def
run
update_if_necessary!
sets
=
SourcesManager
.
all_sets
sets
=
SourcesManager
.
a
ggregate
.
a
ll_sets
sets
.
each
{
|
set
|
UI
.
pod
(
set
,
:name_and_version
)
}
UI
.
puts
"
\n
#{
sets
.
count
}
pods were found"
end
...
...
@@ -47,7 +47,7 @@ module Pod
days
=
[
1
,
2
,
3
,
5
,
8
]
dates
,
groups
=
{},
{}
days
.
each
{
|
d
|
dates
[
d
]
=
Time
.
now
-
60
*
60
*
24
*
d
}
sets
=
SourcesManager
.
all_sets
sets
=
SourcesManager
.
a
ggregate
.
a
ll_sets
statistics_provider
=
Config
.
instance
.
spec_statistics_provider
creation_dates
=
statistics_provider
.
creation_dates
(
sets
)
...
...
lib/cocoapods/sources_manager.rb
View file @
76a369ae
...
...
@@ -5,19 +5,11 @@ module Pod
class
<<
self
include
Config
::
Mixin
# @return [Source::Aggregate] The aggregate of
the sources with the given
# Pods.
# @return [Source::Aggregate] The aggregate of
all the sources with the
#
known
Pods.
#
# @param [Array<#to_s>] source_names
# The names of the sources. If not given all the sources will be
# returned.
#
def
aggregate
(
source_names
=
nil
)
if
source_names
dirs
=
source_names
.
map
{
|
name
|
source_dir
(
name
)
}
else
def
aggregate
dirs
=
config
.
repos_dir
.
children
.
select
(
&
:directory?
)
end
Source
::
Aggregate
.
new
(
dirs
)
end
...
...
@@ -45,13 +37,6 @@ module Pod
sources
([
'master'
])
end
# @return [Array<Specification::Set>] the list of all the specification
# sets know to this installation of CocoaPods.
#
def
all_sets
aggregate
.
all_sets
end
# Search all the sources to match the set for the given dependency.
#
# @return [Set, nil] a set for a given dependency including all the
...
...
@@ -152,10 +137,7 @@ module Pod
Config
.
instance
.
search_index_file
end
public
# @!group Updating Sources
#-----------------------------------------------------------------------#
extend
Executable
executable
:git
...
...
@@ -293,10 +275,7 @@ module Pod
end
end
public
# @!group Master repo
#-----------------------------------------------------------------------#
# @return [Pathname] The path of the master repo.
#
...
...
@@ -313,11 +292,6 @@ module Pod
master_repo_dir
.
exist?
&&
repo_compatible?
(
master_repo_dir
)
end
public
# @!group Source repos
#-----------------------------------------------------------------------#
private
# @return [Bool] Whether the given path is writable by the current user.
...
...
@@ -360,8 +334,7 @@ module Pod
# The name of the source.
#
def
source_dir
(
name
)
dir
=
config
.
repos_dir
+
name
if
dir
if
dir
=
config
.
repos_dir
+
name
dir
else
raise
Informative
,
"Unable to find the `
#{
name
}
` repo."
...
...
spec/functional/command/list_spec.rb
View file @
76a369ae
...
...
@@ -18,7 +18,7 @@ module Pod
end
it
'returns the new pods'
do
sets
=
SourcesManager
.
all_sets
sets
=
SourcesManager
.
a
ggregate
.
a
ll_sets
jsonkit_set
=
sets
.
find
{
|
s
|
s
.
name
==
'JSONKit'
}
dates
=
{
'BananaLib'
=>
Time
.
now
,
...
...
@@ -30,7 +30,7 @@ module Pod
end
it
'presents the known pods with versions'
do
sets
=
SourcesManager
.
all_sets
sets
=
SourcesManager
.
a
ggregate
.
a
ll_sets
jsonkit_set
=
sets
.
find
{
|
s
|
s
.
name
==
'JSONKit'
}
out
=
run_command
(
'list'
)
...
...
spec/unit/sources_manager_spec.rb
View file @
76a369ae
...
...
@@ -48,10 +48,6 @@ module Pod
SourcesManager
.
all
.
map
(
&
:name
).
should
==
%w[master test_repo]
end
it
"returns all the sets"
do
SourcesManager
.
all_sets
.
map
(
&
:name
).
should
.
include?
(
'BananaLib'
)
end
it
"searches for the set of a dependency"
do
set
=
SourcesManager
.
search
(
Dependency
.
new
(
'BananaLib'
))
set
.
class
.
should
==
Specification
::
Set
...
...
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