Skip to content

Commit 75b0a94

Browse files
committed
[rb] various minor updates
1 parent 5413f41 commit 75b0a94

File tree

8 files changed

+54
-51
lines changed

8 files changed

+54
-51
lines changed

examples/ruby/Gemfile.lock

+25-29
Original file line numberDiff line numberDiff line change
@@ -4,76 +4,72 @@ GEM
44
ast (2.4.2)
55
diff-lcs (1.5.0)
66
json (2.6.3)
7-
nokogiri (1.14.0-arm64-darwin)
8-
racc (~> 1.4)
9-
nokogiri (1.14.0-x86_64-darwin)
10-
racc (~> 1.4)
11-
nokogiri (1.14.0-x86_64-linux)
12-
racc (~> 1.4)
13-
parallel (1.22.1)
14-
parser (3.2.0.0)
7+
language_server-protocol (3.17.0.3)
8+
parallel (1.23.0)
9+
parser (3.2.2.3)
1510
ast (~> 2.4.1)
16-
racc (1.6.2)
11+
racc
12+
racc (1.7.1)
1713
rainbow (3.1.1)
1814
rake (13.0.6)
19-
regexp_parser (2.6.2)
15+
regexp_parser (2.8.1)
2016
rexml (3.2.5)
2117
rspec (3.12.0)
2218
rspec-core (~> 3.12.0)
2319
rspec-expectations (~> 3.12.0)
2420
rspec-mocks (~> 3.12.0)
25-
rspec-core (3.12.0)
21+
rspec-core (3.12.2)
2622
rspec-support (~> 3.12.0)
27-
rspec-expectations (3.12.2)
23+
rspec-expectations (3.12.3)
2824
diff-lcs (>= 1.2.0, < 2.0)
2925
rspec-support (~> 3.12.0)
30-
rspec-mocks (3.12.3)
26+
rspec-mocks (3.12.5)
3127
diff-lcs (>= 1.2.0, < 2.0)
3228
rspec-support (~> 3.12.0)
33-
rspec-support (3.12.0)
34-
rubocop (1.44.0)
29+
rspec-support (3.12.1)
30+
rubocop (1.53.1)
3531
json (~> 2.3)
32+
language_server-protocol (>= 3.17.0)
3633
parallel (~> 1.10)
37-
parser (>= 3.2.0.0)
34+
parser (>= 3.2.2.3)
3835
rainbow (>= 2.2.2, < 4.0)
3936
regexp_parser (>= 1.8, < 3.0)
4037
rexml (>= 3.2.5, < 4.0)
41-
rubocop-ast (>= 1.24.1, < 2.0)
38+
rubocop-ast (>= 1.28.0, < 2.0)
4239
ruby-progressbar (~> 1.7)
4340
unicode-display_width (>= 2.4.0, < 3.0)
44-
rubocop-ast (1.24.1)
45-
parser (>= 3.1.1.0)
46-
rubocop-capybara (2.17.0)
41+
rubocop-ast (1.29.0)
42+
parser (>= 3.2.1.0)
43+
rubocop-capybara (2.18.0)
4744
rubocop (~> 1.41)
48-
rubocop-rspec (2.18.1)
45+
rubocop-factory_bot (2.23.1)
46+
rubocop (~> 1.33)
47+
rubocop-rspec (2.22.0)
4948
rubocop (~> 1.33)
5049
rubocop-capybara (~> 2.17)
51-
ruby-progressbar (1.11.0)
50+
rubocop-factory_bot (~> 2.22)
51+
ruby-progressbar (1.13.0)
5252
rubyzip (2.3.2)
53-
selenium-webdriver (4.9.1)
53+
selenium-webdriver (4.10.0)
5454
rexml (~> 3.2, >= 3.2.5)
5555
rubyzip (>= 1.2.2, < 3.0)
5656
websocket (~> 1.0)
5757
unicode-display_width (2.4.2)
58-
webdrivers (5.2.0)
59-
nokogiri (~> 1.6)
60-
rubyzip (>= 1.3.0)
61-
selenium-webdriver (~> 4.0)
6258
websocket (1.2.9)
6359

6460
PLATFORMS
6561
arm64-darwin-21
6662
x86_64-darwin-19
6763
x86_64-darwin-20
64+
x86_64-darwin-22
6865
x86_64-linux
6966

7067
DEPENDENCIES
7168
rake (~> 13.0)
7269
rspec (~> 3.0)
7370
rubocop (~> 1.35)
7471
rubocop-rspec (~> 2.12)
75-
selenium-webdriver (= 4.9.1)
76-
webdrivers (~> 5.1)
72+
selenium-webdriver (= 4.10.0)
7773

7874
BUNDLED WITH
7975
2.3.11

examples/ruby/spec/drivers/service_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
RSpec.describe 'Service' do
66
let(:file_name) { File.expand_path('driver.log') }
7-
let(:driver_path) { "#{ENV['CHROMEWEBDRIVER']}/chromedriver" }
7+
let(:driver_path) { "#{ENV.fetch('CHROMEWEBDRIVER', nil)}/chromedriver" }
88

99
after { FileUtils.rm_f(file_name) }
1010

examples/ruby/spec/spec_helper.rb

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
end
1616

1717
config.before do |example|
18+
unless ENV.fetch('CHROMEWEBDRIVER', nil)
19+
chromedriver = Selenium::WebDriver::DriverFinder.path(Selenium::WebDriver::Options.chrome,
20+
Selenium::WebDriver::Chrome::Service)
21+
ENV['CHROMEWEBDRIVER'] = File.dirname chromedriver
22+
end
23+
1824
bug_tracker = 'https://gigithub.com/SeleniumHQ/seleniumhq.github.io/issues'
1925
guards = Selenium::WebDriver::Support::Guards.new(example,
2026
bug_tracker: bug_tracker)

examples/ruby/spec/troubleshooting/logging_spec.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
RSpec.describe 'Logging' do
66
describe 'Options' do
7-
let(:file_name) { File.expand_path('selenium.log') }
7+
let(:file_name) { Tempfile.new('logging').path }
8+
89
after { FileUtils.rm_f(file_name) }
910

1011
it 'logs things' do

website_and_docs/content/documentation/webdriver/troubleshooting/logging.en.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ For more fine-tuned control, Ruby Selenium created its own Logger class to wrap
4141
This implementation provides some interesting additional features.
4242
Obtain the logger directly from the `#logger`class method on the `Selenium::WebDriver` module:
4343

44-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L11" >}}
44+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L12" >}}
4545
{{% /tab %}}
4646
{{% tab header="JavaScript" %}}
4747
```javascript
@@ -101,7 +101,7 @@ logging.basicConfig(level=logging.WARN)
101101
As of Selenium v4.9.1, The default is `:info`.
102102

103103
To change the level of the logger:
104-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L13" >}}
104+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L14" >}}
105105
{{% /tab %}}
106106
{{% tab header="JavaScript" %}}
107107
JavaScript has 9 logger levels: `OFF`, `SEVERE`, `WARNING`, `INFO`, `DEBUG`, `FINE`, `FINER`, `FINEST`, `ALL`.
@@ -279,7 +279,7 @@ handler with either a `StreamHandler` or a `FileHandler`:
279279
By default, logs are sent to the console in `stdout`.
280280
To store the logs in a file:
281281

282-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L15" >}}
282+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L16" >}}
283283
{{% /tab %}}
284284
{{% tab header="JavaScript" %}}
285285
JavaScript does not currently support sending output to a file.
@@ -319,9 +319,9 @@ Everything that Selenium logs includes an ID. You can also turn on or off all de
319319
using `:deprecations`.
320320

321321
These methods accept one or more symbols or an array of symbols:
322-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#17" >}}
322+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#18" >}}
323323
or
324-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L18" >}}
324+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L19" >}}
325325
{{% /tab %}}
326326
{{< tab header="JavaScript" >}}
327327
{{< alert-content >}}{{< /alert-content >}}

website_and_docs/content/documentation/webdriver/troubleshooting/logging.ja.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ For more fine-tuned control, Ruby Selenium created its own Logger class to wrap
4141
This implementation provides some interesting additional features.
4242
Obtain the logger directly from the `#logger`class method on the `Selenium::WebDriver` module:
4343

44-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L11" >}}
44+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L12" >}}
4545
{{% /tab %}}
4646
{{% tab header="JavaScript" %}}
4747
```javascript
@@ -101,7 +101,7 @@ logging.basicConfig(level=logging.WARN)
101101
As of Selenium v4.9.1, The default is `:info`.
102102

103103
To change the level of the logger:
104-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L13" >}}
104+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L14" >}}
105105
{{% /tab %}}
106106
{{% tab header="JavaScript" %}}
107107
JavaScript has 9 logger levels: `OFF`, `SEVERE`, `WARNING`, `INFO`, `DEBUG`, `FINE`, `FINER`, `FINEST`, `ALL`.
@@ -279,7 +279,7 @@ handler with either a `StreamHandler` or a `FileHandler`:
279279
By default, logs are sent to the console in `stdout`.
280280
To store the logs in a file:
281281

282-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L15" >}}
282+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L16" >}}
283283
{{% /tab %}}
284284
{{% tab header="JavaScript" %}}
285285
JavaScript does not currently support sending output to a file.
@@ -319,9 +319,9 @@ Everything that Selenium logs includes an ID. You can also turn on or off all de
319319
using `:deprecations`.
320320

321321
These methods accept one or more symbols or an array of symbols:
322-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#17" >}}
323-
or
324322
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L18" >}}
323+
or
324+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L19" >}}
325325
{{% /tab %}}
326326
{{< tab header="JavaScript" >}}
327327
{{< alert-content >}}{{< /alert-content >}}

website_and_docs/content/documentation/webdriver/troubleshooting/logging.pt-br.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ For more fine-tuned control, Ruby Selenium created its own Logger class to wrap
4141
This implementation provides some interesting additional features.
4242
Obtain the logger directly from the `#logger`class method on the `Selenium::WebDriver` module:
4343

44-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L11" >}}
44+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L12" >}}
4545
{{% /tab %}}
4646
{{% tab header="JavaScript" %}}
4747
```javascript
@@ -101,7 +101,7 @@ logging.basicConfig(level=logging.WARN)
101101
As of Selenium v4.9.1, The default is `:info`.
102102

103103
To change the level of the logger:
104-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L13" >}}
104+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L14" >}}
105105
{{% /tab %}}
106106
{{% tab header="JavaScript" %}}
107107
JavaScript has 9 logger levels: `OFF`, `SEVERE`, `WARNING`, `INFO`, `DEBUG`, `FINE`, `FINER`, `FINEST`, `ALL`.
@@ -279,7 +279,7 @@ handler with either a `StreamHandler` or a `FileHandler`:
279279
By default, logs are sent to the console in `stdout`.
280280
To store the logs in a file:
281281

282-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L15" >}}
282+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L16" >}}
283283
{{% /tab %}}
284284
{{% tab header="JavaScript" %}}
285285
JavaScript does not currently support sending output to a file.
@@ -319,9 +319,9 @@ Everything that Selenium logs includes an ID. You can also turn on or off all de
319319
using `:deprecations`.
320320

321321
These methods accept one or more symbols or an array of symbols:
322-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#17" >}}
323-
or
324322
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L18" >}}
323+
or
324+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L19" >}}
325325
{{% /tab %}}
326326
{{< tab header="JavaScript" >}}
327327
{{< alert-content >}}{{< /alert-content >}}

website_and_docs/content/documentation/webdriver/troubleshooting/logging.zh-cn.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ For more fine-tuned control, Ruby Selenium created its own Logger class to wrap
4141
This implementation provides some interesting additional features.
4242
Obtain the logger directly from the `#logger`class method on the `Selenium::WebDriver` module:
4343

44-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L11" >}}
44+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L12" >}}
4545
{{% /tab %}}
4646
{{% tab header="JavaScript" %}}
4747
```javascript
@@ -101,7 +101,7 @@ logging.basicConfig(level=logging.WARN)
101101
As of Selenium v4.9.1, The default is `:info`.
102102

103103
To change the level of the logger:
104-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L13" >}}
104+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L14" >}}
105105
{{% /tab %}}
106106
{{% tab header="JavaScript" %}}
107107
JavaScript has 9 logger levels: `OFF`, `SEVERE`, `WARNING`, `INFO`, `DEBUG`, `FINE`, `FINER`, `FINEST`, `ALL`.
@@ -279,7 +279,7 @@ handler with either a `StreamHandler` or a `FileHandler`:
279279
By default, logs are sent to the console in `stdout`.
280280
To store the logs in a file:
281281

282-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L15" >}}
282+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L16" >}}
283283
{{% /tab %}}
284284
{{% tab header="JavaScript" %}}
285285
JavaScript does not currently support sending output to a file.
@@ -319,9 +319,9 @@ Everything that Selenium logs includes an ID. You can also turn on or off all de
319319
using `:deprecations`.
320320

321321
These methods accept one or more symbols or an array of symbols:
322-
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#17" >}}
323-
or
324322
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L18" >}}
323+
or
324+
{{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L19" >}}
325325
{{% /tab %}}
326326
{{< tab header="JavaScript" >}}
327327
{{< alert-content >}}{{< /alert-content >}}

0 commit comments

Comments
 (0)