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
beb588a9
Commit
beb588a9
authored
Apr 04, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Command::Search] Add support for `--ios` and `--osx`
Closes #625
parent
7117139f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
2 deletions
+33
-2
CHANGELOG.md
CHANGELOG.md
+6
-0
search.rb
lib/cocoapods/command/search.rb
+12
-2
BananaLib.podspec
...ures/spec-repos/test_repo/BananaLib/1.0/BananaLib.podspec
+2
-0
search_spec.rb
spec/functional/command/search_spec.rb
+13
-0
No files found.
CHANGELOG.md
View file @
beb588a9
...
...
@@ -13,6 +13,12 @@
non-integrating installations.
[
#918
](
https://github.com/CocoaPods/CocoaPods/issues/918
)
###### Ancillary enhancements
*
The
`pod search`
commands now accepts the
`--ios`
and the
`--osx`
arguments
to filter the results by platform.
[
#625
](
https://github.com/CocoaPods/CocoaPods/issues/625
)
## 0.17.2
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.17.1...0.17.2
)
...
...
lib/cocoapods/command/search.rb
View file @
beb588a9
...
...
@@ -14,13 +14,17 @@ module Pod
def
self
.
options
[[
"--full"
,
"Search by name, summary, and description"
,
"--stats"
,
"Show additional stats (like GitHub watchers and forks)"
"--stats"
,
"Show additional stats (like GitHub watchers and forks)"
,
"--ios"
,
"Restricts the search to Pods supported on iOS"
,
"--osx"
,
"Restricts the search to Pods supported on OS X"
,
]].
concat
(
super
)
end
def
initialize
(
argv
)
@full_text_search
=
argv
.
flag?
(
'full'
)
@stats
=
argv
.
flag?
(
'stats'
)
@supported_on_ios
=
argv
.
flag?
(
'ios'
)
@supported_on_osx
=
argv
.
flag?
(
'osx'
)
@query
=
argv
.
shift_argument
super
end
...
...
@@ -32,10 +36,16 @@ module Pod
def
run
sets
=
SourcesManager
.
search_by_name
(
@query
.
strip
,
@full_text_search
)
if
@supported_on_ios
sets
.
reject!
{
|
set
|
!
set
.
specification
.
available_platforms
.
map
(
&
:name
).
include?
(
:ios
)
}
end
if
@supported_on_osx
sets
.
reject!
{
|
set
|
!
set
.
specification
.
available_platforms
.
map
(
&
:name
).
include?
(
:osx
)
}
end
sets
.
each
do
|
set
|
begin
UI
.
pod
(
set
,
(
@stats
?
:
stats
:
:normal
))
rescue
DSLError
=>
e
rescue
DSLError
UI
.
warn
"Skipping `
#{
set
.
name
}
` because the podspec contains errors."
end
end
...
...
spec/fixtures/spec-repos/test_repo/BananaLib/1.0/BananaLib.podspec
View file @
beb588a9
...
...
@@ -5,6 +5,8 @@ Pod::Spec.new do |s|
s
.
homepage
=
'http://banana-corp.local/banana-lib.html'
s
.
summary
=
'Chunky bananas!'
s
.
description
=
'Full of chunky bananas.'
s
.
platform
=
:ios
s
.
source
=
{
:git
=>
'http://banana-corp.local/banana-lib.git'
,
:tag
=>
'v1.0'
}
s
.
source_files
=
'Classes/*.{h,m}'
,
'Vendor'
s
.
xcconfig
=
{
'OTHER_LDFLAGS'
=>
'-framework SystemConfiguration'
}
...
...
spec/functional/command/search_spec.rb
View file @
beb588a9
...
...
@@ -31,5 +31,18 @@ module Pod
output
=
run_command
(
'search'
,
'Engelhart'
,
'--full'
)
output
.
should
.
include?
'JSONKit'
end
it
"restricts the search to Pods supported on iOS"
do
output
=
run_command
(
'search'
,
'BananaLib'
,
'--ios'
)
output
.
should
.
include?
'BananaLib'
Specification
.
any_instance
.
stubs
(
:available_platforms
).
returns
([
Platform
.
osx
])
output
=
run_command
(
'search'
,
'BananaLib'
,
'--ios'
)
output
.
should
.
not
.
include?
'BananaLib'
end
it
"restricts the search to Pods supported on iOS"
do
output
=
run_command
(
'search'
,
'BananaLib'
,
'--osx'
)
output
.
should
.
not
.
include?
'BananaLib'
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