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