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
329f29ba
Commit
329f29ba
authored
Sep 18, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Source] list the name of the repos.
parent
ffe95281
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
source.rb
lib/cocoapods/source.rb
+17
-7
source_spec.rb
spec/unit/source_spec.rb
+4
-0
No files found.
lib/cocoapods/source.rb
View file @
329f29ba
...
@@ -2,14 +2,20 @@ module Pod
...
@@ -2,14 +2,20 @@ module Pod
class
Source
class
Source
class
Aggregate
class
Aggregate
def
all
def
all
@sources
||=
begin
@sources
||=
dirs
.
map
{
|
repo
|
Source
.
new
(
repo
)
}
repos_dir
=
Config
.
instance
.
repos_dir
end
unless
repos_dir
.
exist?
raise
Informative
,
"No spec repos found in `
#{
repos_dir
}
'. "
\
def
dirs
"To fetch the `master' repo run: $ pod setup"
repos_dir
=
Config
.
instance
.
repos_dir
end
unless
repos_dir
.
exist?
repos_dir
.
children
.
select
(
&
:directory?
).
map
{
|
repo
|
Source
.
new
(
repo
)
}
raise
Informative
,
"No spec repos found in `
#{
repos_dir
}
'. "
\
"To fetch the `master' repo run: $ pod setup"
end
end
repos_dir
.
children
.
select
(
&
:directory?
)
end
def
names
dirs
.
map
{
|
repo
|
repo
.
basename
.
to_s
}.
sort
end
end
def
all_sets
def
all_sets
...
@@ -48,6 +54,10 @@ module Pod
...
@@ -48,6 +54,10 @@ module Pod
Aggregate
.
new
.
search_by_name
(
name
,
full_text_search
)
Aggregate
.
new
.
search_by_name
(
name
,
full_text_search
)
end
end
def
self
.
names
Aggregate
.
new
.
names
end
attr_reader
:repo
attr_reader
:repo
def
initialize
(
repo
)
def
initialize
(
repo
)
...
...
spec/unit/source_spec.rb
View file @
329f29ba
...
@@ -36,4 +36,8 @@ describe "Pod::Source" do
...
@@ -36,4 +36,8 @@ describe "Pod::Source" do
Pod
::
Source
.
search
(
Pod
::
Dependency
.
new
(
'RestKit/DoesNotExist'
))
Pod
::
Source
.
search
(
Pod
::
Dependency
.
new
(
'RestKit/DoesNotExist'
))
}.
should
.
raise
Pod
::
Informative
}.
should
.
raise
Pod
::
Informative
end
end
it
"return the names of the repos"
do
Pod
::
Source
.
names
.
should
==
%w| repo1 repo2 |
end
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