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
d52828ef
Commit
d52828ef
authored
Mar 08, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use caching for ExternalSources::DownloaderSource pods
parent
b664f190
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
14 deletions
+11
-14
config.rb
lib/cocoapods/config.rb
+0
-0
cache.rb
lib/cocoapods/downloader/cache.rb
+4
-2
abstract_external_source.rb
lib/cocoapods/external_sources/abstract_external_source.rb
+5
-10
abstract_external_source_spec.rb
spec/unit/external_sources/abstract_external_source_spec.rb
+2
-2
No files found.
lib/cocoapods/config.rb
View file @
d52828ef
lib/cocoapods/downloader/cache.rb
View file @
d52828ef
...
...
@@ -41,9 +41,11 @@ module Pod
result
=
Result
.
new
if
!
head
&&
result
.
location
=
path_for_pod
(
name
,
version
,
downloader_opts
)
result
.
checkout_options
=
downloader_opts
result
.
location
=
path_for_pod
(
name
,
version
,
downloader_opts
)
unless
head
return
result
if
!
head
&&
result
.
location
.
directory?
result
.
spec
=
spec
||
Sandbox
::
PodspecFinder
.
new
(
result
.
location
).
podspecs
[
name
]
return
result
if
result
.
location
.
directory?
end
in_tmpdir
do
|
target
|
result
.
checkout_options
=
download
(
name
,
target
,
downloader_opts
,
head
)
...
...
lib/cocoapods/external_sources/abstract_external_source.rb
View file @
d52828ef
...
...
@@ -99,22 +99,17 @@ module Pod
UI
.
titled_section
(
title
,
:verbose_prefix
=>
'-> '
)
do
target
=
sandbox
.
pod_dir
(
name
)
target
.
rmtree
if
target
.
exist?
downloader
=
Downloader
.
for_target
(
target
,
params
)
downloader
.
download
podspec_finder
=
Sandbox
::
PodspecFinder
.
new
(
target
)
spec
=
podspec_finder
.
podspecs
[
name
]
download_result
=
Config
.
instance
.
download_cache
.
download_pod
(
name
,
false
,
params
)
FileUtils
.
cp_r
(
download_result
.
location
,
target
)
spec
=
download_result
.
spec
raise
Informative
,
"Unable to find a specification for '
#{
name
}
'."
unless
spec
store_podspec
(
sandbox
,
spec
)
sandbox
.
store_pre_downloaded_pod
(
name
)
if
downloader
.
options_specific?
source
=
params
else
source
=
downloader
.
checkout_options
end
sandbox
.
store_checkout_source
(
name
,
source
)
sandbox
.
store_checkout_source
(
name
,
download_result
.
checkout_options
)
end
end
...
...
spec/unit/external_sources/abstract_external_source_spec.rb
View file @
d52828ef
...
...
@@ -45,9 +45,9 @@ module Pod
end
it
'checks for JSON podspecs'
do
path
=
config
.
sandbox
.
pod_dir
(
'Reachability'
)
path
=
config
.
download_cache
.
send
(
:path_for_pod
,
'Reachability'
,
nil
,
@subject
.
params
)
podspec_path
=
path
+
'Reachability.podspec.json'
Dir
.
mkdir
(
path
)
path
.
mkpath
File
.
open
(
podspec_path
,
'w'
)
{
|
f
|
f
.
write
'{"name":"Reachability"}'
}
Pathname
.
any_instance
.
stubs
(
:rmtree
)
Downloader
::
Git
.
any_instance
.
stubs
(
:download
)
...
...
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