rubium 0.3.0 → 0.3.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.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +4 -2
- data/Rakefile +8 -6
- data/bin/console +4 -3
- data/lib/rubium/browser.rb +48 -50
- data/lib/rubium/version.rb +3 -1
- data/lib/rubium.rb +19 -16
- data/rubium.gemspec +16 -18
- metadata +5 -46
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 32083fd958f5b6419a2acff72d3e16b82081471518c15e87a49dfecf9da1a185
|
|
4
|
+
data.tar.gz: 5059eeb52dadf5403d4402ae6d97f6dd15702b64092ccfa9bfeebad3645a9fce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4f03a7deb8da6691ee76e91ca88b67901fa8df8e43e452e69168beb6d15255fae5f9a1f7fc5b475af755f5d362182b6ebf472bea73ec3a49d4545a9c0a600744
|
|
7
|
+
data.tar.gz: 0b39bf0d315c46611fb197d472419846cc5726c15075ed692dedf1fea2825900c50b9dbd71cf2d775915d6fc1e384d98d5f92e0733ad4b45930816b23e1e1c24
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.1] - 2025-12-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Use [Patchright like](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright?tab=readme-ov-file#command-flags-leaks) CLI args for better antidetect performance
|
|
12
|
+
- Add required Ruby version >= 3.1.0
|
|
13
|
+
- Add Rubocop
|
|
14
|
+
|
|
8
15
|
## [0.3.0] - 2025-12-12
|
|
9
16
|
|
|
10
17
|
### Added
|
data/Gemfile
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
source 'https://rubygems.org'
|
|
4
|
+
|
|
5
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
4
6
|
|
|
5
7
|
# Specify your gem's dependencies in rubium.gemspec
|
|
6
8
|
gemspec
|
data/Rakefile
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'bundler/gem_tasks'
|
|
4
|
+
require 'rake/testtask'
|
|
3
5
|
|
|
4
6
|
Rake::TestTask.new(:test) do |t|
|
|
5
|
-
t.libs <<
|
|
6
|
-
t.libs <<
|
|
7
|
-
t.test_files = FileList[
|
|
7
|
+
t.libs << 'test'
|
|
8
|
+
t.libs << 'lib'
|
|
9
|
+
t.test_files = FileList['test/**/*_test.rb']
|
|
8
10
|
end
|
|
9
11
|
|
|
10
|
-
task :
|
|
12
|
+
task default: :test
|
data/bin/console
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
2
3
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
4
|
+
require 'bundler/setup'
|
|
5
|
+
require 'rubium'
|
|
5
6
|
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
|
@@ -10,5 +11,5 @@ require "rubium"
|
|
|
10
11
|
# require "pry"
|
|
11
12
|
# Pry.start
|
|
12
13
|
|
|
13
|
-
require
|
|
14
|
+
require 'irb'
|
|
14
15
|
IRB.start(__FILE__)
|
data/lib/rubium/browser.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'chrome_remote'
|
|
2
4
|
require 'nokogiri'
|
|
3
5
|
require 'random-port'
|
|
@@ -8,7 +10,7 @@ require 'logger'
|
|
|
8
10
|
require 'fileutils'
|
|
9
11
|
|
|
10
12
|
at_exit do
|
|
11
|
-
Rubium::Browser.running_pids.each { |pid| Process.kill(
|
|
13
|
+
Rubium::Browser.running_pids.each { |pid| Process.kill('HUP', pid) }
|
|
12
14
|
end
|
|
13
15
|
|
|
14
16
|
module Rubium
|
|
@@ -20,7 +22,7 @@ module Rubium
|
|
|
20
22
|
|
|
21
23
|
class << self
|
|
22
24
|
def ports_pool
|
|
23
|
-
@
|
|
25
|
+
@ports_pool ||= RandomPort::Pool.new
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
def running_pids
|
|
@@ -28,13 +30,13 @@ module Rubium
|
|
|
28
30
|
end
|
|
29
31
|
end
|
|
30
32
|
|
|
31
|
-
attr_reader
|
|
33
|
+
attr_reader :client, :devtools_url, :pid, :port, :options, :processed_requests_count, :logger
|
|
32
34
|
|
|
33
35
|
def initialize(options = {})
|
|
34
36
|
@options = options
|
|
35
37
|
|
|
36
38
|
if @options[:enable_logger]
|
|
37
|
-
@logger = Logger.new(
|
|
39
|
+
@logger = Logger.new($stdout)
|
|
38
40
|
@logger.progname = self.class.to_s
|
|
39
41
|
end
|
|
40
42
|
|
|
@@ -42,7 +44,7 @@ module Rubium
|
|
|
42
44
|
end
|
|
43
45
|
|
|
44
46
|
def restart!
|
|
45
|
-
logger.info
|
|
47
|
+
logger.info 'Restarting...' if options[:enable_logger]
|
|
46
48
|
|
|
47
49
|
close
|
|
48
50
|
create_browser
|
|
@@ -50,23 +52,21 @@ module Rubium
|
|
|
50
52
|
|
|
51
53
|
def close
|
|
52
54
|
if closed?
|
|
53
|
-
logger.info
|
|
55
|
+
logger.info 'Browser already has been closed' if options[:enable_logger]
|
|
54
56
|
else
|
|
55
|
-
Process.kill(
|
|
57
|
+
Process.kill('HUP', @pid)
|
|
56
58
|
self.class.running_pids.delete(@pid)
|
|
57
59
|
self.class.ports_pool.release(@port)
|
|
58
60
|
|
|
59
61
|
# Delete temp profile directory, if there is no custom one
|
|
60
|
-
|
|
61
|
-
FileUtils.rm_rf(@data_dir) if Dir.exist?(@data_dir)
|
|
62
|
-
end
|
|
62
|
+
FileUtils.rm_rf(@data_dir) if !options[:data_dir] && Dir.exist?(@data_dir)
|
|
63
63
|
|
|
64
|
-
logger.info
|
|
64
|
+
logger.info 'Closed browser' if options[:enable_logger]
|
|
65
65
|
@closed = true
|
|
66
66
|
end
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
alias destroy_driver! close
|
|
70
70
|
|
|
71
71
|
def closed?
|
|
72
72
|
@closed
|
|
@@ -74,11 +74,9 @@ module Rubium
|
|
|
74
74
|
|
|
75
75
|
def goto(url, wait: options[:max_timeout] || MAX_DEFAULT_TIMEOUT)
|
|
76
76
|
logger.info "Started request: #{url}" if options[:enable_logger]
|
|
77
|
-
if options[:restart_after] && processed_requests_count >= options[:restart_after]
|
|
78
|
-
restart!
|
|
79
|
-
end
|
|
77
|
+
restart! if options[:restart_after] && processed_requests_count >= options[:restart_after]
|
|
80
78
|
|
|
81
|
-
response = @client.send_cmd
|
|
79
|
+
response = @client.send_cmd 'Page.navigate', url: url
|
|
82
80
|
|
|
83
81
|
# By default, after Page.navigate we should wait till page will load completely
|
|
84
82
|
# using Page.loadEventFired. But on some websites with Ajax navigation, Page.loadEventFired
|
|
@@ -87,7 +85,7 @@ module Rubium
|
|
|
87
85
|
# https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameStoppedLoading
|
|
88
86
|
Timeout.timeout(wait) do
|
|
89
87
|
@client.wait_for do |event_name, event_params|
|
|
90
|
-
event_name ==
|
|
88
|
+
event_name == 'Page.frameStoppedLoading' && event_params['frameId'] == response['frameId']
|
|
91
89
|
end
|
|
92
90
|
end
|
|
93
91
|
end
|
|
@@ -96,11 +94,11 @@ module Rubium
|
|
|
96
94
|
logger.info "Finished request: #{url}" if options[:enable_logger]
|
|
97
95
|
end
|
|
98
96
|
|
|
99
|
-
|
|
97
|
+
alias visit goto
|
|
100
98
|
|
|
101
99
|
def body
|
|
102
|
-
response = @client.send_cmd
|
|
103
|
-
response.dig(
|
|
100
|
+
response = @client.send_cmd 'Runtime.evaluate', expression: 'document.documentElement.outerHTML'
|
|
101
|
+
response.dig('result', 'value')
|
|
104
102
|
end
|
|
105
103
|
|
|
106
104
|
def current_response
|
|
@@ -111,6 +109,7 @@ module Rubium
|
|
|
111
109
|
timer = 0
|
|
112
110
|
until current_response.at_xpath(path)
|
|
113
111
|
return false if timer >= wait
|
|
112
|
+
|
|
114
113
|
timer += 0.2 and sleep 0.2
|
|
115
114
|
end
|
|
116
115
|
|
|
@@ -121,6 +120,7 @@ module Rubium
|
|
|
121
120
|
timer = 0
|
|
122
121
|
until current_response.at_css(selector)
|
|
123
122
|
return false if timer >= wait
|
|
123
|
+
|
|
124
124
|
timer += 0.2 and sleep 0.2
|
|
125
125
|
end
|
|
126
126
|
|
|
@@ -131,6 +131,7 @@ module Rubium
|
|
|
131
131
|
timer = 0
|
|
132
132
|
until body&.include?(text)
|
|
133
133
|
return false if timer >= wait
|
|
134
|
+
|
|
134
135
|
timer += 0.2 and sleep 0.2
|
|
135
136
|
end
|
|
136
137
|
|
|
@@ -138,52 +139,52 @@ module Rubium
|
|
|
138
139
|
end
|
|
139
140
|
|
|
140
141
|
def click(selector)
|
|
141
|
-
@client.send_cmd
|
|
142
|
+
@client.send_cmd 'Runtime.evaluate', expression: <<~JS
|
|
142
143
|
document.querySelector(`#{selector}`).click();
|
|
143
|
-
|
|
144
|
+
JS
|
|
144
145
|
end
|
|
145
146
|
|
|
146
147
|
# https://github.com/cyrus-and/chrome-remote-interface/issues/226#issuecomment-320247756
|
|
147
148
|
# https://stackoverflow.com/a/18937620
|
|
148
149
|
def send_key_on(selector, key)
|
|
149
|
-
@client.send_cmd
|
|
150
|
+
@client.send_cmd 'Runtime.evaluate', expression: <<~JS
|
|
150
151
|
document.querySelector(`#{selector}`).dispatchEvent(
|
|
151
152
|
new KeyboardEvent("keydown", {
|
|
152
153
|
bubbles: true, cancelable: true, keyCode: #{key}
|
|
153
154
|
})
|
|
154
155
|
);
|
|
155
|
-
|
|
156
|
+
JS
|
|
156
157
|
end
|
|
157
158
|
|
|
158
159
|
# https://github.com/GoogleChrome/puppeteer/blob/master/lib/Page.js#L784
|
|
159
160
|
# https://stackoverflow.com/questions/46113267/how-to-use-evaluateonnewdocument-and-exposefunction
|
|
160
161
|
# https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-addScriptToEvaluateOnNewDocument
|
|
161
162
|
def evaluate_on_new_document(script)
|
|
162
|
-
@client.send_cmd
|
|
163
|
+
@client.send_cmd 'Page.addScriptToEvaluateOnNewDocument', source: script
|
|
163
164
|
end
|
|
164
165
|
|
|
165
166
|
###
|
|
166
167
|
|
|
167
168
|
def cookies
|
|
168
|
-
response = @client.send_cmd
|
|
169
|
-
response[
|
|
169
|
+
response = @client.send_cmd 'Network.getCookies'
|
|
170
|
+
response['cookies']
|
|
170
171
|
end
|
|
171
172
|
|
|
172
173
|
# https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setCookies
|
|
173
174
|
def set_cookies(cookies)
|
|
174
|
-
@client.send_cmd
|
|
175
|
+
@client.send_cmd 'Network.setCookies', cookies: cookies
|
|
175
176
|
end
|
|
176
177
|
|
|
177
178
|
###
|
|
178
179
|
|
|
179
180
|
def fill_in(selector, text)
|
|
180
|
-
execute_script <<~
|
|
181
|
+
execute_script <<~JS
|
|
181
182
|
document.querySelector(`#{selector}`).value = "#{text}"
|
|
182
|
-
|
|
183
|
+
JS
|
|
183
184
|
end
|
|
184
185
|
|
|
185
186
|
def execute_script(script)
|
|
186
|
-
@client.send_cmd
|
|
187
|
+
@client.send_cmd 'Runtime.evaluate', expression: script
|
|
187
188
|
end
|
|
188
189
|
|
|
189
190
|
private
|
|
@@ -198,13 +199,13 @@ module Rubium
|
|
|
198
199
|
chrome_path = get_chrome_path
|
|
199
200
|
raise ConfigurationError, "Can't find chrome executable" unless chrome_path
|
|
200
201
|
|
|
201
|
-
command = %W
|
|
202
|
+
command = %W[
|
|
202
203
|
#{chrome_path} about:blank
|
|
203
204
|
--remote-debugging-port=#{@port}
|
|
204
205
|
--user-data-dir=#{@data_dir}
|
|
205
|
-
|
|
206
|
+
] + DEFAULT_PUPPETEER_ARGS
|
|
206
207
|
|
|
207
|
-
command <<
|
|
208
|
+
command << '--headless' if ENV['HEADLESS'] != 'false' && options[:headless] != false
|
|
208
209
|
command << "--window-size=#{options[:window_size].join(',')}" if options[:window_size]
|
|
209
210
|
|
|
210
211
|
if options[:user_agent]
|
|
@@ -214,11 +215,11 @@ module Rubium
|
|
|
214
215
|
|
|
215
216
|
if options[:proxy_server]
|
|
216
217
|
proxy_server = options[:proxy_server].respond_to?(:call) ? options[:proxy_server].call : options[:proxy_server]
|
|
217
|
-
proxy_server = convert_proxy(proxy_server) unless proxy_server.include?(
|
|
218
|
+
proxy_server = convert_proxy(proxy_server) unless proxy_server.include?('://')
|
|
218
219
|
command << "--proxy-server=#{proxy_server}"
|
|
219
220
|
end
|
|
220
221
|
|
|
221
|
-
@pid = spawn(*command, [
|
|
222
|
+
@pid = spawn(*command, %i[out err] => '/dev/null')
|
|
222
223
|
self.class.running_pids << @pid
|
|
223
224
|
@closed = false
|
|
224
225
|
|
|
@@ -233,9 +234,9 @@ module Rubium
|
|
|
233
234
|
@devtools_url = "http://localhost:#{@port}/"
|
|
234
235
|
|
|
235
236
|
# https://github.com/GoogleChrome/puppeteer/blob/master/lib/Page.js
|
|
236
|
-
@client.send_cmd
|
|
237
|
-
@client.send_cmd
|
|
238
|
-
@client.send_cmd
|
|
237
|
+
@client.send_cmd 'Target.setAutoAttach', autoAttach: true, waitForDebuggerOnStart: false
|
|
238
|
+
@client.send_cmd 'Network.enable'
|
|
239
|
+
@client.send_cmd 'Page.enable'
|
|
239
240
|
|
|
240
241
|
evaluate_on_new_document(options[:extension_code]) if options[:extension_code]
|
|
241
242
|
|
|
@@ -244,32 +245,29 @@ module Rubium
|
|
|
244
245
|
if options[:urls_blacklist] || options[:disable_images]
|
|
245
246
|
urls = []
|
|
246
247
|
|
|
247
|
-
if options[:urls_blacklist]
|
|
248
|
-
urls += options[:urls_blacklist]
|
|
249
|
-
end
|
|
248
|
+
urls += options[:urls_blacklist] if options[:urls_blacklist]
|
|
250
249
|
|
|
251
250
|
if options[:disable_images]
|
|
252
|
-
urls += %w
|
|
253
|
-
urls <<
|
|
251
|
+
urls += %w[jpg jpeg png gif swf svg tif].map { |ext| ["*.#{ext}", "*.#{ext}?*"] }.flatten
|
|
252
|
+
urls << 'data:image*'
|
|
254
253
|
end
|
|
255
254
|
|
|
256
|
-
@client.send_cmd
|
|
255
|
+
@client.send_cmd 'Network.setBlockedURLs', urls: urls
|
|
257
256
|
end
|
|
258
257
|
|
|
259
|
-
|
|
260
|
-
logger.info "Opened browser" if options[:enable_logger]
|
|
258
|
+
logger.info 'Opened browser' if options[:enable_logger]
|
|
261
259
|
end
|
|
262
260
|
|
|
263
261
|
def get_chrome_path
|
|
264
|
-
path = Rubium.configuration.chrome_path || Cliver.detect(
|
|
262
|
+
path = Rubium.configuration.chrome_path || Cliver.detect('chromium-browser') || Cliver.detect('google-chrome')
|
|
265
263
|
return path if path
|
|
266
264
|
|
|
267
|
-
macos_path =
|
|
265
|
+
macos_path = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
|
|
268
266
|
macos_path if File.executable?(macos_path)
|
|
269
267
|
end
|
|
270
268
|
|
|
271
269
|
def convert_proxy(proxy_string)
|
|
272
|
-
ip, port, type,
|
|
270
|
+
ip, port, type, = proxy_string.split(':')
|
|
273
271
|
"#{type}://#{ip}:#{port}"
|
|
274
272
|
end
|
|
275
273
|
end
|
data/lib/rubium/version.rb
CHANGED
data/lib/rubium.rb
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'ostruct'
|
|
2
4
|
require 'rubium/version'
|
|
3
5
|
require 'rubium/browser'
|
|
4
6
|
|
|
5
7
|
module Rubium
|
|
6
|
-
DEFAULT_PUPPETEER_ARGS = %w
|
|
8
|
+
DEFAULT_PUPPETEER_ARGS = %w[
|
|
9
|
+
--disable-field-trial-config
|
|
7
10
|
--disable-background-networking
|
|
8
11
|
--disable-background-timer-throttling
|
|
9
12
|
--disable-backgrounding-occluded-windows
|
|
10
13
|
--disable-breakpad
|
|
11
|
-
--
|
|
12
|
-
--disable-default-apps
|
|
14
|
+
--no-default-browser-check
|
|
13
15
|
--disable-dev-shm-usage
|
|
14
|
-
--disable-
|
|
15
|
-
--
|
|
16
|
+
--disable-features=AcceptCHFrame,AvoidUnnecessaryBeforeUnloadCheckSync,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Translate,AutoDeElevate,RenderDocument,OptimizationHints
|
|
17
|
+
--enable-features=CDPScreenshotNewSurface
|
|
16
18
|
--disable-hang-monitor
|
|
17
|
-
--disable-ipc-flooding-protection
|
|
18
|
-
--disable-popup-blocking
|
|
19
19
|
--disable-prompt-on-repost
|
|
20
20
|
--disable-renderer-backgrounding
|
|
21
|
-
--
|
|
22
|
-
--disable-translate
|
|
23
|
-
--metrics-recording-only
|
|
21
|
+
--force-color-profile=srgb
|
|
24
22
|
--no-first-run
|
|
25
|
-
--safebrowsing-disable-auto-update
|
|
26
|
-
--enable-automation
|
|
27
23
|
--password-store=basic
|
|
28
24
|
--use-mock-keychain
|
|
29
|
-
--
|
|
30
|
-
--
|
|
31
|
-
--
|
|
25
|
+
--no-service-autorun
|
|
26
|
+
--export-tagged-pdf
|
|
27
|
+
--disable-search-engine-choice-screen
|
|
28
|
+
--edge-skip-compat-layer-relaunch
|
|
32
29
|
--disable-infobars
|
|
30
|
+
--disable-search-engine-choice-screen
|
|
31
|
+
--disable-sync
|
|
33
32
|
--disable-blink-features=AutomationControlled
|
|
34
|
-
|
|
33
|
+
--enable-unsafe-swiftshader
|
|
34
|
+
--no-sandbox
|
|
35
|
+
--force-webrtc-ip-handling-policy=disable_non_proxied_udp
|
|
36
|
+
--webrtc-ip-handling-policy=disable_non_proxied_udp
|
|
37
|
+
].freeze
|
|
35
38
|
|
|
36
39
|
def self.configuration
|
|
37
40
|
@configuration ||= OpenStruct.new
|
data/rubium.gemspec
CHANGED
|
@@ -1,32 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
|
|
2
|
-
lib = File.expand_path(
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require
|
|
5
|
+
require 'rubium/version'
|
|
5
6
|
|
|
6
7
|
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name =
|
|
8
|
+
spec.name = 'rubium'
|
|
8
9
|
spec.version = Rubium::VERSION
|
|
9
|
-
spec.authors = [
|
|
10
|
-
spec.email = [
|
|
10
|
+
spec.authors = ['Victor Afanasev']
|
|
11
|
+
spec.email = ['vicfreefly@gmail.com']
|
|
11
12
|
|
|
12
|
-
spec.summary =
|
|
13
|
+
spec.summary = 'Headless Chromium Ruby API based on ChromeRemote gem'
|
|
13
14
|
spec.description = spec.summary
|
|
14
|
-
spec.homepage =
|
|
15
|
-
spec.license =
|
|
15
|
+
spec.homepage = 'https://github.com/vifreefly/rubium'
|
|
16
|
+
spec.license = 'MIT'
|
|
16
17
|
|
|
17
18
|
# Specify which files should be added to the gem when it is released.
|
|
18
19
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
19
|
-
spec.files = Dir.chdir(File.expand_path(
|
|
20
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
20
21
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
21
22
|
end
|
|
22
|
-
spec.require_paths = [
|
|
23
|
+
spec.require_paths = ['lib']
|
|
24
|
+
spec.required_ruby_version = '>= 3.1.0'
|
|
23
25
|
|
|
24
|
-
spec.add_dependency
|
|
25
|
-
spec.add_dependency
|
|
26
|
-
spec.add_dependency
|
|
27
|
-
spec.add_dependency
|
|
28
|
-
|
|
29
|
-
spec.add_development_dependency "bundler", "~> 2.4"
|
|
30
|
-
spec.add_development_dependency "rake", "~> 13.0"
|
|
31
|
-
spec.add_development_dependency "minitest", "~> 5.22"
|
|
26
|
+
spec.add_dependency 'chrome_remote', '~> 0.3'
|
|
27
|
+
spec.add_dependency 'cliver', '~> 0.3'
|
|
28
|
+
spec.add_dependency 'nokogiri'
|
|
29
|
+
spec.add_dependency 'random-port'
|
|
32
30
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubium
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Victor Afanasev
|
|
@@ -38,7 +38,7 @@ dependencies:
|
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
39
|
version: '0.3'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
|
-
name:
|
|
41
|
+
name: nokogiri
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
44
|
- - ">="
|
|
@@ -52,7 +52,7 @@ dependencies:
|
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
53
|
version: '0'
|
|
54
54
|
- !ruby/object:Gem::Dependency
|
|
55
|
-
name:
|
|
55
|
+
name: random-port
|
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
|
57
57
|
requirements:
|
|
58
58
|
- - ">="
|
|
@@ -65,48 +65,6 @@ dependencies:
|
|
|
65
65
|
- - ">="
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
67
|
version: '0'
|
|
68
|
-
- !ruby/object:Gem::Dependency
|
|
69
|
-
name: bundler
|
|
70
|
-
requirement: !ruby/object:Gem::Requirement
|
|
71
|
-
requirements:
|
|
72
|
-
- - "~>"
|
|
73
|
-
- !ruby/object:Gem::Version
|
|
74
|
-
version: '2.4'
|
|
75
|
-
type: :development
|
|
76
|
-
prerelease: false
|
|
77
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
-
requirements:
|
|
79
|
-
- - "~>"
|
|
80
|
-
- !ruby/object:Gem::Version
|
|
81
|
-
version: '2.4'
|
|
82
|
-
- !ruby/object:Gem::Dependency
|
|
83
|
-
name: rake
|
|
84
|
-
requirement: !ruby/object:Gem::Requirement
|
|
85
|
-
requirements:
|
|
86
|
-
- - "~>"
|
|
87
|
-
- !ruby/object:Gem::Version
|
|
88
|
-
version: '13.0'
|
|
89
|
-
type: :development
|
|
90
|
-
prerelease: false
|
|
91
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
-
requirements:
|
|
93
|
-
- - "~>"
|
|
94
|
-
- !ruby/object:Gem::Version
|
|
95
|
-
version: '13.0'
|
|
96
|
-
- !ruby/object:Gem::Dependency
|
|
97
|
-
name: minitest
|
|
98
|
-
requirement: !ruby/object:Gem::Requirement
|
|
99
|
-
requirements:
|
|
100
|
-
- - "~>"
|
|
101
|
-
- !ruby/object:Gem::Version
|
|
102
|
-
version: '5.22'
|
|
103
|
-
type: :development
|
|
104
|
-
prerelease: false
|
|
105
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
106
|
-
requirements:
|
|
107
|
-
- - "~>"
|
|
108
|
-
- !ruby/object:Gem::Version
|
|
109
|
-
version: '5.22'
|
|
110
68
|
description: Headless Chromium Ruby API based on ChromeRemote gem
|
|
111
69
|
email:
|
|
112
70
|
- vicfreefly@gmail.com
|
|
@@ -115,6 +73,7 @@ extensions: []
|
|
|
115
73
|
extra_rdoc_files: []
|
|
116
74
|
files:
|
|
117
75
|
- ".gitignore"
|
|
76
|
+
- ".rubocop.yml"
|
|
118
77
|
- CHANGELOG.md
|
|
119
78
|
- Gemfile
|
|
120
79
|
- LICENSE.txt
|
|
@@ -137,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
137
96
|
requirements:
|
|
138
97
|
- - ">="
|
|
139
98
|
- !ruby/object:Gem::Version
|
|
140
|
-
version:
|
|
99
|
+
version: 3.1.0
|
|
141
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
101
|
requirements:
|
|
143
102
|
- - ">="
|