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
787345f1
Commit
787345f1
authored
Feb 23, 2014
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Search] Don't validate for valid regex on web searchs
parent
a3ec49e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
search.rb
lib/cocoapods/command/search.rb
+7
-3
search_spec.rb
spec/functional/command/search_spec.rb
+6
-1
No files found.
lib/cocoapods/command/search.rb
View file @
787345f1
...
...
@@ -36,9 +36,13 @@ module Pod
super
help!
"A search query is required."
unless
@query
/
#{
@query
.
join
(
' '
).
strip
}
/
rescue
RegexpError
help!
"A valid regular expression is required."
unless
@web
begin
/
#{
@query
.
join
(
' '
).
strip
}
/
rescue
RegexpError
help!
"A valid regular expression is required."
end
end
end
def
run
...
...
spec/functional/command/search_spec.rb
View file @
787345f1
...
...
@@ -50,7 +50,7 @@ module Pod
output
.
should
.
include?
'BananaLib'
end
it
"shows a friendly message when searching with invalid regex"
do
it
"shows a friendly message when
locally
searching with invalid regex"
do
lambda
{
run_command
(
'search'
,
'+'
)
}.
should
.
raise
CLAide
::
Help
end
...
...
@@ -58,6 +58,11 @@ module Pod
extend
SpecHelper
::
TemporaryRepos
it
"searches with invalid regex"
do
Command
::
Search
.
any_instance
.
expects
(
:open!
).
with
(
'http://cocoapods.org/?q=NSAttributedString+CCLFormat'
)
run_command
(
'search'
,
'--web'
,
'NSAttributedString+CCLFormat'
)
end
it
"searches the web via the open! command"
do
Command
::
Search
.
any_instance
.
expects
(
:open!
).
with
(
'http://cocoapods.org/?q=bananalib'
)
run_command
(
'search'
,
'--web'
,
'bananalib'
)
...
...
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