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
33a03a9b
Commit
33a03a9b
authored
Apr 03, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SourcesManager] Search robustness.
Closes #929
parent
419a524e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
CHANGELOG.md
CHANGELOG.md
+3
-1
sources_manager.rb
lib/cocoapods/sources_manager.rb
+4
-0
sources_manager_spec.rb
spec/unit/sources_manager_spec.rb
+1
-1
No files found.
CHANGELOG.md
View file @
33a03a9b
...
@@ -5,7 +5,9 @@
...
@@ -5,7 +5,9 @@
###### Bug fixes
###### Bug fixes
*
Fix crash related to the specification of the workspace as a relative path.
*
Fix crash related to the specification of the workspace as a relative path.
[
#917
](
https://github.com/CocoaPods/CocoaPods/issues/920
)
[
#920
](
https://github.com/CocoaPods/CocoaPods/issues/920
)
*
Fix crash related to search from the command line.
[
#929
](
https://github.com/CocoaPods/CocoaPods/issues/929
)
###### Ancillary enhancements
###### Ancillary enhancements
...
...
lib/cocoapods/sources_manager.rb
View file @
33a03a9b
...
@@ -95,10 +95,14 @@ module Pod
...
@@ -95,10 +95,14 @@ module Pod
def
updated_search_index
def
updated_search_index
if
search_index_path
.
exist?
if
search_index_path
.
exist?
stored_index
=
YAML
.
load
(
search_index_path
.
read
)
stored_index
=
YAML
.
load
(
search_index_path
.
read
)
if
stored_index
&&
stored_index
.
is_a?
(
Hash
)
search_index
=
aggregate
.
update_search_index
(
stored_index
)
search_index
=
aggregate
.
update_search_index
(
stored_index
)
else
else
search_index
=
aggregate
.
generate_search_index
search_index
=
aggregate
.
generate_search_index
end
end
else
search_index
=
aggregate
.
generate_search_index
end
File
.
open
(
search_index_path
,
'w'
)
{
|
f
|
f
.
write
(
search_index
.
to_yaml
)
}
File
.
open
(
search_index_path
,
'w'
)
{
|
f
|
f
.
write
(
search_index
.
to_yaml
)
}
search_index
search_index
...
...
spec/unit/sources_manager_spec.rb
View file @
33a03a9b
...
@@ -59,7 +59,7 @@ module Pod
...
@@ -59,7 +59,7 @@ module Pod
end
end
it
"updates the search index before performing a search if it exits"
do
it
"updates the search index before performing a search if it exits"
do
File
Utils
.
touch
(
SourcesManager
.
search_index_path
)
File
.
open
(
SourcesManager
.
search_index_path
,
'w'
)
{
|
file
|
file
.
write
(
"---
\n
BananaLib:
\n
version: 0.0.1"
)
}
Source
::
Aggregate
.
any_instance
.
stubs
(
:all
).
returns
([
@test_source
])
Source
::
Aggregate
.
any_instance
.
stubs
(
:all
).
returns
([
@test_source
])
Source
::
Aggregate
.
any_instance
.
expects
(
:generate_search_index
).
never
Source
::
Aggregate
.
any_instance
.
expects
(
:generate_search_index
).
never
Source
::
Aggregate
.
any_instance
.
expects
(
:update_search_index
).
returns
({
'BananaLib'
=>
{}})
Source
::
Aggregate
.
any_instance
.
expects
(
:update_search_index
).
returns
({
'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