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
f6f51505
Commit
f6f51505
authored
Oct 23, 2015
by
Muhammed Yavuz Nuzumlali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multi word query search. Use symbols as pod references in search index.
parent
84243011
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
sources_manager.rb
lib/cocoapods/sources_manager.rb
+10
-6
No files found.
lib/cocoapods/sources_manager.rb
View file @
f6f51505
...
...
@@ -114,15 +114,19 @@ module Pod
#
def
search_by_name
(
query
,
full_text_search
=
false
)
if
full_text_search
set_names
=
Set
.
new
query_
regexp
=
/
#{
query
}
/i
query_word_regexps
=
query
.
split
.
map
{
|
word
|
/
#{
word
}
/i
}
query_
word_results_hash
=
{}
updated_search_index
.
each_value
do
|
word_spec_hash
|
word_spec_hash
.
each_pair
do
|
word
,
spec_names
|
set_names
.
merge
(
spec_names
)
unless
word
!~
query_regexp
word_spec_hash
.
each_pair
do
|
word
,
spec_symbols
|
query_word_regexps
.
each
do
|
query_word_regexp
|
set
=
(
query_word_results_hash
[
query_word_regexp
]
||=
Set
.
new
)
set
.
merge
(
spec_symbols
)
if
word
=~
query_word_regexp
end
end
end
sets
=
set_names
.
map
do
|
name
|
aggregate
.
representative_set
(
name
)
found_set_symbols
=
query_word_results_hash
.
values
.
reduce
(
:&
)
sets
=
found_set_symbols
.
map
do
|
symbol
|
aggregate
.
representative_set
(
symbol
.
to_s
)
end
# Remove nil values because representative_set return nil if no pod is found in any of the sources.
sets
.
compact!
...
...
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