cocoapods-core 1.9.0.beta.2 → 1.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-core/cdn_source.rb +10 -4
- data/lib/cocoapods-core/gem_version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54fe39c5a8d2e28001ef66999f292a88604274247f3e59655ccd365beaf1b42c
|
4
|
+
data.tar.gz: 6dcfaa8628e0252eebf2c745a901a5fd78a0a88519d3fc679567f9e5c278fb0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9047cbd1aa7f9bdb1c15aa85e2c837de09289483c029fb375c51dfc62880f5061a606594c5c391d0a9766149e0ba4949032ba763e1b29bfbe3ea0a873f82560c
|
7
|
+
data.tar.gz: 02ffef659eeeaa0c5bfe8227b030b30e477f6682c45d83ab49886ba29e8853a6483b1f6f97b00f3c07671a82215e4cfeec25405f4acf7f2fb61c8f25dd56665a
|
@@ -315,6 +315,11 @@ module Pod
|
|
315
315
|
metadata.path_fragment(pod_name)[0..-2]
|
316
316
|
end
|
317
317
|
|
318
|
+
def local_file_okay?(partial_url)
|
319
|
+
file_path = repo.join(partial_url)
|
320
|
+
File.exist?(file_path) && File.size(file_path) > 0
|
321
|
+
end
|
322
|
+
|
318
323
|
def local_file(partial_url)
|
319
324
|
file_path = repo.join(partial_url)
|
320
325
|
File.open(file_path) do |file|
|
@@ -337,7 +342,8 @@ module Pod
|
|
337
342
|
file_remote_url = URI.encode(url + partial_url.to_s)
|
338
343
|
path = repo + partial_url
|
339
344
|
|
340
|
-
|
345
|
+
file_okay = local_file_okay?(partial_url)
|
346
|
+
if file_okay
|
341
347
|
if @startup_time < File.mtime(path)
|
342
348
|
debug "CDN: #{name} Relative path: #{partial_url} modified during this run! Returning local"
|
343
349
|
return Promises.fulfilled_future(partial_url, HYDRA_EXECUTOR)
|
@@ -353,7 +359,7 @@ module Pod
|
|
353
359
|
|
354
360
|
etag_path = path.sub_ext(path.extname + '.etag')
|
355
361
|
|
356
|
-
etag = File.read(etag_path) if File.exist?(etag_path)
|
362
|
+
etag = File.read(etag_path) if file_okay && File.exist?(etag_path)
|
357
363
|
debug "CDN: #{name} Relative path: #{partial_url}, has ETag? #{etag}" unless etag.nil?
|
358
364
|
|
359
365
|
download_and_save_with_retries_async(partial_url, file_remote_url, etag)
|
@@ -376,9 +382,9 @@ module Pod
|
|
376
382
|
FileUtils.touch path
|
377
383
|
partial_url
|
378
384
|
when 200
|
379
|
-
File.open(path, 'w') { |f| f.write(response.response_body) }
|
385
|
+
File.open(path, 'w') { |f| f.write(response.response_body.force_encoding('UTF-8')) }
|
380
386
|
|
381
|
-
etag_new = response.headers['etag']
|
387
|
+
etag_new = response.headers['etag'] unless response.headers.nil?
|
382
388
|
debug "CDN: #{name} Relative path downloaded: #{partial_url}, save ETag: #{etag_new}"
|
383
389
|
File.open(etag_path, 'w') { |f| f.write(etag_new) } unless etag_new.nil?
|
384
390
|
partial_url
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eloy Duran
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-05-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|