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
5fb94da0
Commit
5fb94da0
authored
Mar 23, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#177] @alloy's suggestions
parent
9bb3e73e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
search.rb
lib/cocoapods/command/search.rb
+7
-10
No files found.
lib/cocoapods/command/search.rb
View file @
5fb94da0
...
@@ -12,13 +12,13 @@ module Pod
...
@@ -12,13 +12,13 @@ module Pod
end
end
def
self
.
options
def
self
.
options
" --
extended Show details that require network access (like GitHub stat
s)
\n
"
+
" --
stats Show additional stats (like GitHub watchers and fork
s)
\n
"
+
" --full Search by name, summary, and description
\n
"
" --full Search by name, summary, and description
\n
"
super
super
end
end
def
initialize
(
argv
)
def
initialize
(
argv
)
@
extended
=
argv
.
option
(
'--extended
'
)
@
stats
=
argv
.
option
(
'--stats
'
)
@full_text_search
=
argv
.
option
(
'--full'
)
@full_text_search
=
argv
.
option
(
'--full'
)
unless
@query
=
argv
.
arguments
.
first
unless
@query
=
argv
.
arguments
.
first
super
super
...
@@ -31,7 +31,9 @@ module Pod
...
@@ -31,7 +31,9 @@ module Pod
puts_wrapped_text
(
set
.
specification
.
summary
)
puts_wrapped_text
(
set
.
specification
.
summary
)
puts_detail
(
'Homepage'
,
set
.
specification
.
homepage
)
puts_detail
(
'Homepage'
,
set
.
specification
.
homepage
)
print_extended_info
(
set
.
specification
.
source
)
if
@extended
source
=
set
.
specification
.
source
.
values
[
0
]
puts_detail
(
'Source'
,
source
)
puts_github_info
(
source
)
if
@stats
puts
puts
end
end
...
@@ -45,18 +47,13 @@ module Pod
...
@@ -45,18 +47,13 @@ module Pod
def
puts_detail
(
title
,
string
)
def
puts_detail
(
title
,
string
)
return
if
!
string
return
if
!
string
# 8 is the length of homepage which might be displayed alone
number_of_spaces
=
((
8
-
title
.
length
)
>
0
)
?
(
8
-
title
.
length
)
:
0
number_of_spaces
=
((
8
-
title
.
length
)
>
0
)
?
(
8
-
title
.
length
)
:
0
spaces
=
' '
*
number_of_spaces
spaces
=
' '
*
number_of_spaces
puts
" -
#{
title
}
:
#{
spaces
+
string
}
"
puts
" -
#{
title
}
:
#{
spaces
+
string
}
"
end
end
def
print_extended_info
(
source
)
def
puts_github_info
(
url
)
source_url
=
source
[
:git
]
||
source
[
:hg
]
||
source
[
:svn
]
||
source
[
:local
]
puts_detail
(
'Source'
,
source_url
)
print_github_info
(
source_url
)
if
source_url
=~
/github.com/
end
def
print_github_info
(
url
)
original_url
,
username
,
reponame
=
*
(
url
.
match
(
/[:\/]([\w\-]+)\/([\w\-]+)\.git/
).
to_a
)
original_url
,
username
,
reponame
=
*
(
url
.
match
(
/[:\/]([\w\-]+)\/([\w\-]+)\.git/
).
to_a
)
if
original_url
if
original_url
...
...
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