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
55117eb3
Commit
55117eb3
authored
Feb 13, 2014
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search: Present a user friendly message with invalid regex
Fixes #1821
parent
e42d5f6e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
CHANGELOG.md
CHANGELOG.md
+4
-0
search.rb
lib/cocoapods/command/search.rb
+4
-0
search_spec.rb
spec/functional/command/search_spec.rb
+5
-1
No files found.
CHANGELOG.md
View file @
55117eb3
...
@@ -13,6 +13,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
...
@@ -13,6 +13,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[
Jeff Verkoeyen
](
https://github.com/jverkoey
)
[
Jeff Verkoeyen
](
https://github.com/jverkoey
)
[
#1803
](
https://github.com/CocoaPods/CocoaPods/pull/1803
)
[
#1803
](
https://github.com/CocoaPods/CocoaPods/pull/1803
)
*
Improves the error message when searching with an invalid regular expression.
[
Kyle Fuller
](
https://github.com/kylef
)
## 0.29.0
## 0.29.0
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.28.0...0.29.0
)
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.28.0...0.29.0
)
•
[
CocoaPods-core
](
https://github.com/CocoaPods/Core/compare/0.28.0...0.29.0
)
•
[
CocoaPods-core
](
https://github.com/CocoaPods/Core/compare/0.28.0...0.29.0
)
...
...
lib/cocoapods/command/search.rb
View file @
55117eb3
...
@@ -35,6 +35,10 @@ module Pod
...
@@ -35,6 +35,10 @@ module Pod
def
validate!
def
validate!
super
super
help!
"A search query is required."
unless
@query
help!
"A search query is required."
unless
@query
/
#{
@query
.
join
(
' '
).
strip
}
/
rescue
RegexpError
help!
"A valid regular expression is required."
end
end
def
run
def
run
...
...
spec/functional/command/search_spec.rb
View file @
55117eb3
...
@@ -49,7 +49,11 @@ module Pod
...
@@ -49,7 +49,11 @@ module Pod
output
=
run_command
(
'search'
,
'BananaLib'
,
'--silent'
)
output
=
run_command
(
'search'
,
'BananaLib'
,
'--silent'
)
output
.
should
.
include?
'BananaLib'
output
.
should
.
include?
'BananaLib'
end
end
it
"shows a friendly message when searching with invalid regex"
do
lambda
{
run_command
(
'search'
,
'+'
)
}.
should
.
raise
CLAide
::
Help
end
describe
"option --web"
do
describe
"option --web"
do
extend
SpecHelper
::
TemporaryRepos
extend
SpecHelper
::
TemporaryRepos
...
...
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