chrome-fetcher 0.0.1

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 (4) hide show
  1. checksums.yaml +7 -0
  2. data/lib/chrome-fetcher.rb +6 -0
  3. data/lib/extconf.rb +22 -0
  4. metadata +73 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c05c3ba103a5e6d45b39c0140dcbe5a7e064714eea928c9ada0d2bd10a9084b7
4
+ data.tar.gz: facae422e36c1760379662894c29250561cf28e74741a7303da386949d448158
5
+ SHA512:
6
+ metadata.gz: b9d8ab288a52fd0c8514adc291b74ac8e60d863459c5777a88b2b69531e66a4163fb12667bcee688e610f2e7211f3299f65fae13cdad5b24a95c8a82069c7aa5
7
+ data.tar.gz: 9a7156a622aaf7ed7e3df7f4a1c48b626dd8d94dd42322f8d006fd673c2a1c75a18f19d679d32e8347c2dadb9489d930f4e424d1d07098eb078b4522ab11731d
@@ -0,0 +1,6 @@
1
+ class Chrome
2
+ attr_accessor :path
3
+ def initialize()
4
+ @path = "#{ Gem.loaded_specs['chrome-fetcher'].full_gem_path}/chrome-linux/chrome"
5
+ end
6
+ end
data/lib/extconf.rb ADDED
@@ -0,0 +1,22 @@
1
+ require "excon"
2
+ require "zip"
3
+ chromium_url = "http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64"
4
+ latest_version = Excon.get("#{chromium_url}/LAST_CHANGE").body
5
+ latest_version_url = "#{chromium_url}/#{latest_version}/chrome-linux.zip"
6
+
7
+ File.open("#{Dir.pwd}/chrome-linux.zip", "w") { |f| f.write Excon.get(latest_version_url).body }
8
+ Zip::File.open("#{Dir.pwd}/chrome-linux.zip") do |zip_file|
9
+ zip_file.each do |f|
10
+ fpath = File.join("#{Dir.pwd}", f.name)
11
+ zip_file.extract(f, fpath) unless File.exist?(fpath)
12
+ end
13
+ end
14
+ File.delete("#{Dir.pwd}/chrome-linux.zip") if File.exist?("#{Dir.pwd}/chrome-linux.zip")
15
+ dummy_make_content = "make:\n" \
16
+ "\t:\n" \
17
+ "install:\n" \
18
+ "\t:\n" \
19
+ "clean:\n" \
20
+ "\t:\n"
21
+ File.write('Makefile', dummy_make_content)
22
+
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: chrome-fetcher
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Marchi Lau
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-09-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: excon
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubyzip
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Fetch and install latest Chrome binary for Linux.
42
+ email: marchi.lau@gmail.com
43
+ executables: []
44
+ extensions:
45
+ - lib/extconf.rb
46
+ extra_rdoc_files: []
47
+ files:
48
+ - lib/chrome-fetcher.rb
49
+ - lib/extconf.rb
50
+ homepage: https://rubygems.org/gems/chrome-fetcher
51
+ licenses:
52
+ - MIT
53
+ metadata: {}
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubygems_version: 3.1.6
70
+ signing_key:
71
+ specification_version: 4
72
+ summary: Hola!
73
+ test_files: []