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
a7f504fb
Commit
a7f504fb
authored
Oct 27, 2015
by
Muhammed Yavuz Nuzumlali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix offenses
parent
482f0669
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
24 deletions
+25
-24
sources_manager.rb
lib/cocoapods/sources_manager.rb
+14
-13
update_spec.rb
spec/functional/command/repo/update_spec.rb
+4
-4
sources_manager_spec.rb
spec/unit/sources_manager_spec.rb
+7
-7
No files found.
lib/cocoapods/sources_manager.rb
View file @
a7f504fb
...
...
@@ -114,7 +114,7 @@ module Pod
#
def
search_by_name
(
query
,
full_text_search
=
false
)
if
full_text_search
query_word_regexps
=
query
.
split
.
map
{
|
word
|
/
#{
word
}
/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_symbols
|
...
...
@@ -161,7 +161,7 @@ module Pod
unless
index
[
source_name
]
UI
.
print
"Creating search index for spec repo '
#{
source_name
}
'.."
index
[
source_name
]
=
aggregate
.
generate_search_index_for_source
(
source
)
UI
.
puts
" Done!"
UI
.
puts
' Done!'
end
end
save_search_index
(
index
)
...
...
@@ -216,6 +216,7 @@ module Pod
# Update is performed incrementally. Only the changed pods' search data is re-generated and updated.
# @param [Hash{Source => Array<String>}] changed_spec_paths
# A hash containing changed specification paths for each source.
#
def
update_search_index_if_needed
(
changed_spec_paths
)
search_index
=
stored_search_index
return
unless
search_index
...
...
@@ -242,6 +243,9 @@ module Pod
end
# Updates search index for changed pods in background
# @param [Hash{Source => Array<String>}] changed_spec_paths
# A hash containing changed specification paths for each source.
#
def
update_search_index_if_needed_in_background
(
changed_spec_paths
)
Process
.
fork
do
Process
.
daemon
...
...
@@ -540,15 +544,13 @@ module Pod
executable
:git
def
update_git_repo
(
show_output
=
false
)
begin
output
=
git!
%w(pull --ff-only)
UI
.
puts
output
if
show_output
rescue
UI
.
warn
'CocoaPods was not able to update the '
\
"`
#{
name
}
` repo. If this is an unexpected issue "
\
'and persists you can inspect it running '
\
'`pod repo update --verbose`'
end
output
=
git!
%w(pull --ff-only)
UI
.
puts
output
if
show_output
rescue
UI
.
warn
'CocoaPods was not able to update the '
\
"`
#{
name
}
` repo. If this is an unexpected issue "
\
'and persists you can inspect it running '
\
'`pod repo update --verbose`'
end
end
end
\ No newline at end of file
end
spec/functional/command/repo/update_spec.rb
View file @
a7f504fb
...
...
@@ -28,12 +28,12 @@ module Pod
repo2
=
repo_clone
(
'repo1'
,
'repo2'
)
repo_make_readme_change
(
repo1
,
'Updated'
)
Dir
.
chdir
(
repo1
)
{
`git commit -a -m "Update"`
}
SourcesManager
.
expects
(
:update_search_index_if_needed_in_background
).
with
()
{
|
value
|
value
.
each_pair
{
|
source
,
paths
|
SourcesManager
.
expects
(
:update_search_index_if_needed_in_background
).
with
do
|
value
|
value
.
each_pair
do
|
source
,
paths
|
source
.
name
.
should
==
'repo2'
paths
.
should
==
[
'README'
]
}
}
end
end
run_command
(
'repo'
,
'update'
,
'repo2'
)
(
repo2
+
'README'
).
read
.
should
.
include
'Updated'
end
...
...
spec/unit/sources_manager_spec.rb
View file @
a7f504fb
...
...
@@ -244,14 +244,14 @@ module Pod
end
it
'updates search index for changed paths if source is updated'
do
prev_index
=
{
@test_source
.
name
=>
{}
}
prev_index
=
{
@test_source
.
name
=>
{}
}
SourcesManager
.
expects
(
:stored_search_index
).
returns
(
prev_index
)
SourcesManager
.
expects
(
:save_search_index
).
with
()
{
|
value
|
SourcesManager
.
expects
(
:save_search_index
).
with
do
|
value
|
value
[
@test_source
.
name
][
'BananaLib'
].
should
.
include
(
:BananaLib
)
value
[
@test_source
.
name
][
'JSONKit'
].
should
.
include
(
:JSONKit
)
}
changed_paths
=
{
@test_source
=>
%w(BananaLib/1.0/BananaLib.podspec JSONKit/1.4/JSONKit.podspec)
}
end
changed_paths
=
{
@test_source
=>
%w(BananaLib/1.0/BananaLib.podspec JSONKit/1.4/JSONKit.podspec)
}
SourcesManager
.
update_search_index_if_needed
(
changed_paths
)
end
...
...
@@ -259,10 +259,10 @@ module Pod
prev_index
=
{}
SourcesManager
.
expects
(
:stored_search_index
).
returns
(
prev_index
)
SourcesManager
.
expects
(
:save_search_index
).
with
()
{
|
value
|
SourcesManager
.
expects
(
:save_search_index
).
with
do
|
value
|
value
[
@test_source
.
name
].
should
.
be
.
nil
}
changed_paths
=
{
@test_source
=>
%w(BananaLib/1.0/BananaLib.podspec JSONKit/1.4/JSONKit.podspec)
}
end
changed_paths
=
{
@test_source
=>
%w(BananaLib/1.0/BananaLib.podspec JSONKit/1.4/JSONKit.podspec)
}
SourcesManager
.
update_search_index_if_needed
(
changed_paths
)
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