chromate-rb 0.0.4.pre → 0.0.6.pre

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8771288942a6c244191f958285641c9cd157fbc0a707841590ad15902f84bc42
4
- data.tar.gz: 9ef7424f1d5daff53d4abb3027ad4c8d93bd4178032594f026a005422f200d13
3
+ metadata.gz: adcd20017c87a89e95877b60e3841a0a1b198bc37adedbfe0f4278c7b61b2946
4
+ data.tar.gz: cbaaca5361715c5683804007b5bb305417056924e37f4d08da224a8f014abee5
5
5
  SHA512:
6
- metadata.gz: e123a057316f5f0644b3460f07e9cd33bbf0694f6bc946a48eaf71f39dfbdf601adeb58793522f1758c218350de4aa12a6be92048bcaf3093a12d559d4a7d8fc
7
- data.tar.gz: 5f8c3cef9c6ed6bc238e259994a771356cd3a5bf852e521dd9b063ed619dcba8f0883ef3d58ece60f0ab65aaedfb106d58acdc4fc6b003086f09ce85676e9a1c
6
+ metadata.gz: c084f6add0ca1a8333cbd567707bc3d2e640bd964d9cfd965bb7a3182517d8b9343c62279f14600802d1e9ac5509f2b73aa74696f49348fcd3d40987ec68221b
7
+ data.tar.gz: be9688e57273b947e08bc4c1091f0632036001e21067db5bc6a63cbe1947d1b87a496a806a5d0ea95fdc704ca3fe6ecef81e04c07ffecd4b1dfc95ce77eea8c8
@@ -12,7 +12,7 @@ module BotBrowser
12
12
  version ||= versions.keys.first
13
13
  profile ||= profiles[version].keys.first
14
14
  version = version.to_sym
15
- binary_path = download_file(versions[version][platform], "/tmp/botbrowser_#{version}_#{platform}.dmg")
15
+ binary_path = download_file(versions[version][platform], "/tmp/botbrowser_#{version}_#{platform}.#{extension(platform)}")
16
16
  profile_path = download_file(profiles[version][profile], "/tmp/botbrowser_#{version}_#{platform}.json")
17
17
 
18
18
  [binary_path, profile_path]
@@ -25,6 +25,19 @@ module BotBrowser
25
25
  path
26
26
  end
27
27
 
28
+ def extension(platform)
29
+ case platform
30
+ when :mac
31
+ 'dmg'
32
+ when :linux
33
+ 'deb'
34
+ when :windows
35
+ '7z'
36
+ else
37
+ raise 'Unsupported platform'
38
+ end
39
+ end
40
+
28
41
  def versions
29
42
  {
30
43
  v132: {
@@ -13,7 +13,7 @@ module BotBrowser
13
13
 
14
14
  def install(version = nil)
15
15
  create_config_dir
16
- binary_path, profile_path = Downloader.download(version)
16
+ binary_path, profile_path = Downloader.download(version, nil, platform)
17
17
  bot_browser_path = install_binary(binary_path)
18
18
  bot_browser_profile_path = install_profile(profile_path)
19
19
 
@@ -42,6 +42,18 @@ module BotBrowser
42
42
 
43
43
  private
44
44
 
45
+ def platform
46
+ if mac?
47
+ :mac
48
+ elsif linux?
49
+ :linux
50
+ elsif windows?
51
+ :windows
52
+ else
53
+ raise 'Unsupported platform'
54
+ end
55
+ end
56
+
45
57
  def install_binary(binary_path)
46
58
  Chromate::CLogger.log("Installing binary from #{binary_path}")
47
59
  return install_binary_mac(binary_path) if mac?
@@ -74,8 +86,8 @@ module BotBrowser
74
86
  end
75
87
 
76
88
  def install_binary_linux(binary_path)
77
- Chromate::Binary.run('sudo', ['dpkg', '-i', binary_path])
78
- Chromate::Binary.run('sudo', ['apt-get', 'install', '-f'])
89
+ Chromate::Binary.run('dpkg', ['-i', binary_path])
90
+ Chromate::Binary.run('apt-get', ['install', '-f'])
79
91
 
80
92
  '/usr/bin/chromium'
81
93
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chromate
4
- VERSION = '0.0.4.pre'
4
+ VERSION = '0.0.6.pre'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chromate-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4.pre
4
+ version: 0.0.6.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eth3rnit3
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-20 00:00:00.000000000 Z
11
+ date: 2025-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi