Skip to content

Commit 5cdc472

Browse files
authored
Merge pull request #99 from fastruby/update-ruby
Update ruby to 4.0.10
2 parents 5cb8e2b + d4c9123 commit 5cdc472

7 files changed

Lines changed: 41 additions & 6 deletions

File tree

‎.ruby-version‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.4
1+
4.0.10

‎.tool-versions‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
ruby 4.0.4
1+
ruby 4.0.10
22
nodejs 24.18.0

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile:1
2-
FROM ruby:4.0.4
2+
FROM ruby:4.0.10
33

44
RUN dpkg --add-architecture i386 \
55
&& apt-get update -qq \

‎Gemfile.lock‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ DEPENDENCIES
453453
wkhtmltopdf-binary (= 0.12.3.1)
454454

455455
RUBY VERSION
456-
ruby 4.0.4
456+
ruby 4.0.10
457457

458458
BUNDLED WITH
459459
4.0.15

‎Gemfile.next.lock‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ DEPENDENCIES
453453
wkhtmltopdf-binary (= 0.12.3.1)
454454

455455
RUBY VERSION
456-
ruby 4.0.4
456+
ruby 4.0.10
457457

458458
BUNDLED WITH
459459
4.0.15

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You can see it working in https://audit.fastruby.io
66

77
## Requirements
88

9-
- Ruby version `4.0.4` (see `.ruby-version` / `.tool-versions`)
9+
- Ruby version `4.0.10` (see `.ruby-version` / `.tool-versions`)
1010
- Node version `24.18.0` (see `.tool-versions`)
1111
- Docker + Docker Compose (recommended for local development)
1212

‎test/application_system_test_case.rb‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,41 @@
3636
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options, service: service)
3737
end
3838

39+
# Capybara 3.40.0 clears storage with `origin: "*"`, which recent Chrome
40+
# rejects. Clear the app server's origin instead. The version guard turns this
41+
# off once a Capybara release with the fix is installed.
42+
# https://github.com/teamcapybara/capybara/pull/2867
43+
# https://github.com/teamcapybara/capybara/pull/2868
44+
if Gem::Version.new(Capybara::VERSION) <= Gem::Version.new("3.40.0")
45+
Capybara::Selenium::Driver::ChromeDriver.class_eval do
46+
# Mirrors Capybara's upstream reset!, so keep its shape rather than splitting it up.
47+
# :reek:TooManyStatements
48+
def reset!
49+
# Use instance variable directly so we avoid starting the browser just to reset the session
50+
return unless @browser
51+
52+
switch_to_window(window_handles.first)
53+
window_handles.slice(1..).each { |win| close_window(win) }
54+
return super if chromedriver_version < 73
55+
56+
timer = Capybara::Helpers.timer(expire_in: 10)
57+
begin
58+
clear_storage unless uniform_storage_clear?
59+
@browser.navigate.to('about:blank')
60+
wait_for_empty_page(timer)
61+
rescue *unhandled_alert_errors
62+
accept_unhandled_reset_alert
63+
retry
64+
end
65+
66+
# base_url includes the random port Capybara's server listens on, which
67+
# Storage.clearDataForOrigin needs to match the app's storage.
68+
origin = Capybara.current_session.server&.base_url
69+
execute_cdp('Storage.clearDataForOrigin', origin: origin, storageTypes: storage_types_to_clear) if origin
70+
end
71+
end
72+
end
73+
3974
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4075
driven_by :headless_chromium
4176
end

0 commit comments

Comments
 (0)