chrome-fetcher 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/extconf.rb +10 -7
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a260d07b6f23cb0d2430ad56a2eadc7deac80b45d230d02b8ea050d11585367c
4
- data.tar.gz: fdc8bb70c2dea3230899fd0150c9af497020a8c42e8f3a3ac85cbe72fa01d128
3
+ metadata.gz: 677eac222ec5aacbdc29b8608380c0fb981e0abe36e2712424aec693589ee427
4
+ data.tar.gz: e0438c9d04c259585d54bcea88dad7da80e0652d4e26e48e0719566c2de8c819
5
5
  SHA512:
6
- metadata.gz: '0844d555dcbd6946af8d3eed050922a5782ad405b298a1de0448b082b9a06c4e5770319eb46f530ad8ea94da56506fd202eceaeae5cddf6e5ff47bd3b6720112'
7
- data.tar.gz: 71953da08feaf7fa084ffefabe0478b93182f9cf5861e59c867d2b2e00b6d19207b1545fb9fb38b13526b540b81f7e7d1bc46630c15f2ff276d32f8ce2b1f046
6
+ metadata.gz: 4df7debed6e2f9e57a88cdc4aaca9e3fd99e6e8145ee61196cbcb0d1e958d71c4c540b662718470fe5a2d2202ec7c638743548c483d75725bba99b230e83b74c
7
+ data.tar.gz: 5eb49d5c3476ed8603e926a88d2c7e4558c0903f1ec729d02f6aca69d825242b554667d7110742eb11c01985961ab38a8c8c8f48121a3f8cc976621e0f8792eb
data/lib/extconf.rb CHANGED
@@ -4,13 +4,16 @@ chromium_url = "http://commondatastorage.googleapis.com/chromium-browser-snapsho
4
4
  latest_version = Excon.get("#{chromium_url}/LAST_CHANGE").body
5
5
  latest_version_url = "#{chromium_url}/#{latest_version}/chrome-linux.zip"
6
6
 
7
- # url = "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F961656%2Fchrome-linux.zip?generation=1642723767466615&alt=media"
8
-
9
- File.open("#{Dir.pwd}/chrome-linux.zip", "w") { |f| f.write Excon.get(latest_version_url).body }
10
- Zip::File.open("#{Dir.pwd}/chrome-linux.zip") do |zip_file|
11
- zip_file.each do |f|
12
- fpath = File.join("#{Dir.pwd}", f.name)
13
- zip_file.extract(f, fpath) unless File.exist?(fpath)
7
+ file = "#{Dir.pwd}/chrome-linux.zip"
8
+ File.open(file, "w") { |f| f.write Excon.get(latest_version_url).body }
9
+ Zip::File.open(file) do |zipfile|
10
+ to = File.join(File.dirname(file), File.basename(file, ".*"))
11
+ FileUtils.mkdir(to) unless File.exists? to
12
+ zipfile.each do |f|
13
+ if f.file? # Don't extract directories
14
+ fpath = File.join(to, File.basename(f.name))
15
+ zipfile.extract(f, fpath) unless File.exists?(fpath)
16
+ end
14
17
  end
15
18
  end
16
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chrome-fetcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marchi Lau