diff --git a/.github/workflows/ci-rbe.yml b/.github/workflows/ci-rbe.yml index 382aea6409f2a..2e15949925580 100644 --- a/.github/workflows/ci-rbe.yml +++ b/.github/workflows/ci-rbe.yml @@ -15,7 +15,7 @@ jobs: with: name: Check format script run caching: false - ruby-version: jruby-9.4.5.0 + ruby-version: jruby-9.4.8.0 run: ./scripts/github-actions/check-format.sh test: @@ -25,5 +25,5 @@ jobs: with: name: All RBE tests caching: false - ruby-version: jruby-9.4.5.0 + ruby-version: jruby-9.4.8.0 run: ./scripts/github-actions/ci-build.sh diff --git a/.github/workflows/ci-ruby.yml b/.github/workflows/ci-ruby.yml index 419e17df5065c..88cf3512ebfba 100644 --- a/.github/workflows/ci-ruby.yml +++ b/.github/workflows/ci-ruby.yml @@ -39,17 +39,17 @@ jobs: fail-fast: false matrix: include: - - ruby-version: 3.0.6 + - ruby-version: 3.1.6 os: ubuntu - - ruby-version: 3.0.6 + - ruby-version: 3.1.6 os: windows - - ruby-version: 3.0.6 + - ruby-version: 3.1.6 os: macos - - ruby-version: 3.3.0 + - ruby-version: 3.3.5 os: ubuntu - - ruby-version: jruby-9.4.5.0 + - ruby-version: jruby-9.4.8.0 os: ubuntu - - ruby-version: truffleruby-23.1.1 + - ruby-version: truffleruby-24.1.1 os: ubuntu with: name: Unit Tests (${{ matrix.ruby-version }}, ${{ matrix.os }}) diff --git a/MODULE.bazel b/MODULE.bazel index a1b464caee2c5..b52df075394b5 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -25,7 +25,7 @@ bazel_dep(name = "rules_oci", version = "1.7.6") bazel_dep(name = "rules_pkg", version = "0.10.1") bazel_dep(name = "rules_python", version = "0.33.0") bazel_dep(name = "rules_proto", version = "6.0.0") -bazel_dep(name = "rules_ruby", version = "0.11.0") +bazel_dep(name = "rules_ruby", version = "0.13.0") linter = use_extension("@apple_rules_lint//lint:extensions.bzl", "linter") linter.configure( @@ -257,7 +257,7 @@ ruby.bundle_fetch( "//:rb/selenium-webdriver.gemspec", ], gem_checksums = { - "activesupport-7.2.1": "7557fa077a592a4f36f7ddacf4d9d71c34aff69ed20236b8a61c22d567da8c24", + "activesupport-7.2.1.2": "6c3f6ad50c4e52ce39d67aeda38f99e1372eca8b295987d072c19460ebce4cb1", "addressable-2.8.7": "462986537cf3735ab5f3c0f557f14155d778f4b43ea4f485a9deb9c8f7c58232", "ast-2.4.2": "1e280232e6a33754cde542bc5ef85520b74db2aac73ec14acef453784447cc12", "base64-0.2.0": "0f25e9b21a02a0cc0cea8ef92b2041035d39350946e8789c562b2d1a3da01507", @@ -267,7 +267,7 @@ ruby.bundle_fetch( "connection_pool-2.4.1": "0f40cf997091f1f04ff66da67eabd61a9fe0d4928b9a3645228532512fab62f4", "crack-1.0.0": "c83aefdb428cdc7b66c7f287e488c796f055c0839e6e545fec2c7047743c4a49", "csv-3.3.0": "0bbd1defdc31134abefed027a639b3723c2753862150f4c3ee61cab71b20d67d", - "curb-1.0.5": "2c4755dfb5d6190e9ebb4407b23ac5a5c2c226be1449e6d3bdf625656352efd1", + "curb-1.0.6": "b369434efa91dc7310d72a74f8a228a5b920e3d5a89b0a3097e4c6a905af6eb2", "debug-1.9.2": "48e026c0852c7a10c60263e2e527968308958e266231e36d64e3efcabec7e7fc", "diff-lcs-1.5.1": "273223dfb40685548436d32b4733aa67351769c7dea621da7d9dd4813e63ddfe", "drb-2.2.1": "e9d472bf785f558b96b25358bae115646da0dbfd45107ad858b0bc0d935cb340", @@ -277,45 +277,45 @@ ruby.bundle_fetch( "fileutils-1.7.2": "36a0fb324218263e52b486ad7408e9a295378fe8edc9fd343709e523c0980631", "git-1.19.1": "b0a422d9f6517353c48a330d6114de4db9e0c82dbe7202964a1d9f1fbc827d70", "hashdiff-1.1.1": "c7966316726e0ceefe9f5c6aef107ebc3ccfef8b6db55fe3934f046b2cf0936a", - "i18n-1.14.5": "26dcbc05e364b57e27ab430148b3377bc413987d34cc042336271d8f42e9d1b9", + "i18n-1.14.6": "dc229a74f5d181f09942dd60ab5d6e667f7392c4ee826f35096db36d1fe3614c", "io-console-0.7.2": "f0dccff252f877a4f60d04a4dc6b442b185ebffb4b320ab69212a92b48a7a221", "io-console-0.7.2-java": "73aa382f8832b116613ceaf57b8ff5bf73dfedcaf39f0aa5420e10f63a4543ed", - "irb-1.14.0": "53d805013bbd194874b8c13a56aca6aebcd11dd79166d88724f8a434fedde615", + "irb-1.14.1": "5975003b58d36efaf492380baa982ceedf5aed36967a4d5b40996bc5c66e80f8", "jar-dependencies-0.4.1": "b2df2f1ecbff15334ce20ea7fdd5b8d8161faab67761ff72c7647d728e40d387", - "json-2.7.2": "1898b5cbc81cd36c0fd4d0b7ad2682c39fb07c5ff682fc6265f678f550d4982c", - "json-2.7.2-java": "138e3038b5361b3d06ee2e8aa2be00bed0d0de4ef5f1553fc5935e5b93aca7ee", + "json-2.7.4": "9ea6258b4add3abd25df965515be8b19be417f58b8c42619c7f2d3e86c158ece", + "json-2.7.4-java": "5d5d1593d8727a66f2e4161710dde06ba7043c9b3fa9eea0889fdc0450a107cd", "language_server-protocol-3.17.0.3": "3d5c58c02f44a20d972957a9febe386d7e7468ab3900ce6bd2b563dd910c6b3f", "listen-3.9.0": "db9e4424e0e5834480385197c139cb6b0ae0ef28cc13310cfd1ca78377d59c67", - "logger-1.6.0": "0ab7c120262dd8de2a18cb8d377f1f318cbe98535160a508af9e7710ff43ef3e", + "logger-1.6.1": "3ad9587ed3940bf7897ea64a673971415523f4f7d6b22c5e3af5219705669653", "minitest-5.25.1": "3db6795a80634def1cf86fda79d2d83b59b25ce5e186fa675f73c565589d2ad8", "parallel-1.26.3": "d86babb7a2b814be9f4b81587bf0b6ce2da7d45969fab24d8ae4bf2bb4d4c7ef", - "parser-3.3.4.2": "71efa8690c2a1ff8937258ff5713add4894dcea8b4ba19055692e28a2469c9e6", + "parser-3.3.5.0": "f30ebb71b7830c2e7cdc4b2b0e0ec2234900e3fca3fe2fba47f78be759181ab3", "psych-5.1.2": "337322f58fc2bf24827d2b9bd5ab595f6a72971867d151bb39980060ea40a368", "psych-5.1.2-java": "1dd68dc609eddbc884e6892e11da942e16f7256bd30ebde9d35449d43043a6fe", "public_suffix-6.0.1": "61d44e1cab5cbbbe5b31068481cf16976dd0dc1b6b07bd95617ef8c5e3e00c6f", "racc-1.8.1": "4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f", "racc-1.8.1-java": "54f2e6d1e1b91c154013277d986f52a90e5ececbe91465d29172e49342732b98", - "rack-2.2.9": "fd6301a97a1c1e955e68f85c861fcb1cde6145a32c532e1ea321a72ff8cc4042", + "rack-2.2.10": "e4a5ee3f8f2ba45614a4498114d6dc7da1c51a0f0dd810d891906ea71d3aa72b", "rainbow-3.1.1": "039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a", "rake-13.2.1": "46cb38dae65d7d74b6020a4ac9d48afed8eb8149c040eccf0523bec91907059d", "rb-fsevent-0.11.2": "43900b972e7301d6570f64b850a5aa67833ee7d87b458ee92805d56b7318aefe", "rb-inotify-0.11.1": "a0a700441239b0ff18eb65e3866236cd78613d6b9f78fea1f9ac47a85e47be6e", - "rbs-3.5.3": "f262eea0db1e40eaa154266096b1a4272bc965a81d78acb0e54b58b4dc11f052", + "rbs-3.6.1": "ed7273d018556844583d1785ac54194e67eec594d68e317d57fa90ad035532c0", "rchardet-1.8.0": "693acd5253d5ade81a51940697955f6dd4bb2f0d245bda76a8e23deec70a52c7", "rdoc-6.7.0": "b17d5f0f57b0853d7b880d4360a32c7caf8dbb81f8503a36426df809e617f379", "regexp_parser-2.9.2": "5a27e767ad634f8a4b544520d5cd28a0db7aa1198a5d7c9d7e11d7b3d9066446", - "reline-0.5.9": "5d2dd7ed0fd078e79a05e4eaa47dc91b8dacec7358e9e1dd6d9c4636cff7d378", - "rexml-3.3.6": "7af0459d108dfd6ffa7d38c67c8464e200f5c9d476d4c6a3d1899e92808d63c6", + "reline-0.5.10": "1660c969a792ebd034e6ceee8ca628f3b6698dcdb34f7a282a5edda37b958166", + "rexml-3.3.9": "d71875b85299f341edf47d44df0212e7658cbdf35aeb69cefdb63f57af3137c9", "rspec-3.13.0": "d490914ac1d5a5a64a0e1400c1d54ddd2a501324d703b8cfe83f458337bab993", - "rspec-core-3.13.0": "557792b4e88da883d580342b263d9652b6a10a12d5bda9ef967b01a48f15454c", - "rspec-expectations-3.13.2": "565fb94ab39923c0fe6a16cfc9570d1821b741917a50800373fcbbb752c7a45a", - "rspec-mocks-3.13.1": "087189899c337937bcf1d66a50dc3fc999ac88335bbeba4d385c2a38c87d7b38", + "rspec-core-3.13.2": "94fbda6e4738e478f1c7532b7cc241272fcdc8b9eac03a97338b1122e4573300", + "rspec-expectations-3.13.3": "0e6b5af59b900147698ea0ff80456c4f2e69cac4394fbd392fbd1ca561f66c58", + "rspec-mocks-3.13.2": "2327335def0e1665325a9b617e3af9ae20272741d80ac550336309a7c59abdef", "rspec-support-3.13.1": "48877d4f15b772b7538f3693c22225f2eda490ba65a0515c4e7cf6f2f17de70f", - "rubocop-1.65.1": "3a239b71fcfdeb32c654f4b48c2e6aeb4f77b128e348fa9442184f207e70718d", - "rubocop-ast-1.32.1": "6a86ce3b7aa8ff8b600396d8f75ef5f85873b94bf0a1ae11607c19e65ced79c1", + "rubocop-1.67.0": "8ccca7226e76d0a9974af960ea446d1fb38adf0c491214294e2fed75a85c378c", + "rubocop-ast-1.32.3": "40201e861c73a3c2d59428c7627828ef81fb2f8a306bc4a1c1801452afe3fe0f", "rubocop-capybara-2.21.0": "5d264efdd8b6c7081a3d4889decf1451a1cfaaec204d81534e236bc825b280ab", "rubocop-factory_bot-2.26.1": "8de13cd4edcee5ca800f255188167ecef8dbfc3d1fae9f15734e9d2e755392aa", - "rubocop-performance-1.21.1": "5cf20002a544275ad6aa99abca4b945d2a2ed71be925c38fe83700360ed8734e", + "rubocop-performance-1.22.1": "9ed9737af1ee90655654b483e0eac4e64702139e85d33335bf744b57a309a679", "rubocop-rake-0.6.0": "56b6f22189af4b33d4f4e490a555c09f1281b02f4d48c3a61f6e8fe5f401d8db", "rubocop-rspec-2.31.0": "2bae19388d78e1ceace44cd95fd34f3209f4ef20cac1b168d0a1325cbba3d672", "rubocop-rspec_rails-2.29.1": "4ae95abbe9ca5a9b6d8be14e50d230fb5b6ba033b05d4c0981b5b76fc44988e4", @@ -328,11 +328,11 @@ ruby.bundle_fetch( "strscan-3.1.0-java": "8645aa76e017e21764c6df572d2d79fcc1672284014f5bdbd806278cdbcd11b0", "terminal-table-3.0.2": "f951b6af5f3e00203fb290a669e0a85c5dd5b051b3b023392ccfd67ba5abae91", "tzinfo-2.0.6": "8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b", - "unicode-display_width-2.5.0": "7e7681dcade1add70cb9fda20dd77f300b8587c81ebbd165d14fd93144ff0ab4", - "webmock-3.23.1": "0fa738c0767d1c4ec8cc57f6b21998f0c238c8a5b32450df1c847f2767140d95", - "webrick-1.8.1": "19411ec6912911fd3df13559110127ea2badd0c035f7762873f58afc803e158f", + "unicode-display_width-2.6.0": "12279874bba6d5e4d2728cef814b19197dbb10d7a7837a869bab65da943b7f5a", + "webmock-3.24.0": "be01357f6fc773606337ca79f3ba332b7d52cbe5c27587671abc0572dbec7122", + "webrick-1.8.2": "431746a349199546ff9dd272cae10849c865f938216e41c402a6489248f12f21", "websocket-1.2.11": "b7e7a74e2410b5e85c25858b26b3322f29161e300935f70a0e0d3c35e0462737", - "yard-0.9.36": "5505736c1b00c926f71053a606ab75f02070c5960d0778b901fe9d8b0a470be4", + "yard-0.9.37": "a6e910399e78e613f80ba9add9ba7c394b1a935f083cccbef82903a3d2a26992", }, gemfile = "//:rb/Gemfile", gemfile_lock = "//:rb/Gemfile.lock", diff --git a/rb/.rubocop.yml b/rb/.rubocop.yml index 14142a7db62a8..0e1f819a1d856 100644 --- a/rb/.rubocop.yml +++ b/rb/.rubocop.yml @@ -4,7 +4,7 @@ require: - rubocop-rspec AllCops: - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.1 NewCops: enable Exclude: - !ruby/regexp /lib\/selenium\/devtools\/v\d+/ diff --git a/rb/.ruby-version b/rb/.ruby-version index 818bd47abfc91..9cec7165ab0a0 100644 --- a/rb/.ruby-version +++ b/rb/.ruby-version @@ -1 +1 @@ -3.0.6 +3.1.6 diff --git a/rb/README.md b/rb/README.md index 651b47dc6828a..aacb9db114b10 100644 --- a/rb/README.md +++ b/rb/README.md @@ -1,6 +1,6 @@ # selenium-webdriver -This gem provides Ruby bindings for Selenium and supports MRI >= 3.0. +This gem provides Ruby bindings for Selenium and supports MRI >= 3.1. ## Install diff --git a/rb/lib/selenium/server.rb b/rb/lib/selenium/server.rb index 7d031f26af07d..ad63ca25eb936 100644 --- a/rb/lib/selenium/server.rb +++ b/rb/lib/selenium/server.rb @@ -122,15 +122,15 @@ def available_assets end end - def net_http_start(address, &block) + def net_http_start(address, &) http_proxy = ENV.fetch('http_proxy', nil) || ENV.fetch('HTTP_PROXY', nil) if http_proxy http_proxy = "http://#{http_proxy}" unless http_proxy.start_with?('http://') uri = URI.parse(http_proxy) - Net::HTTP.start(address, nil, uri.host, uri.port, &block) + Net::HTTP.start(address, nil, uri.host, uri.port, &) else - Net::HTTP.start(address, use_ssl: true, &block) + Net::HTTP.start(address, use_ssl: true, &) end end diff --git a/rb/lib/selenium/webdriver/bidi.rb b/rb/lib/selenium/webdriver/bidi.rb index 0beb1d024578a..500f75859bc37 100644 --- a/rb/lib/selenium/webdriver/bidi.rb +++ b/rb/lib/selenium/webdriver/bidi.rb @@ -38,8 +38,8 @@ def callbacks @ws.callbacks end - def add_callback(event, &block) - @ws.add_callback(event, &block) + def add_callback(event, &) + @ws.add_callback(event, &) end def remove_callback(event, id) diff --git a/rb/lib/selenium/webdriver/bidi/log_inspector.rb b/rb/lib/selenium/webdriver/bidi/log_inspector.rb index 133666cec0f01..4c7ff02100a72 100644 --- a/rb/lib/selenium/webdriver/bidi/log_inspector.rb +++ b/rb/lib/selenium/webdriver/bidi/log_inspector.rb @@ -79,7 +79,7 @@ def on_javascript_exception(&block) end end - def on_log(filter_by = nil, &block) + def on_log(filter_by = nil, &) unless filter_by.nil? check_valid_filter(filter_by) @@ -89,14 +89,14 @@ def on_log(filter_by = nil, &block) return end - on(:entry_added, &block) + on(:entry_added, &) end private - def on(event, &block) + def on(event, &) event = EVENTS[event] if event.is_a?(Symbol) - @bidi.add_callback("log.#{event}", &block) + @bidi.add_callback("log.#{event}", &) end def check_valid_filter(filter_by) diff --git a/rb/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb b/rb/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb index 0cedd98ba3b52..3339426157d91 100644 --- a/rb/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +++ b/rb/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb @@ -59,9 +59,9 @@ module HasNetworkInterception # @yieldparam [Proc] continue block which proceeds with the request and optionally yields response # - def intercept(&block) + def intercept(&) @interceptor ||= DevTools::NetworkInterceptor.new(devtools) - @interceptor.intercept(&block) + @interceptor.intercept(&) end end # HasNetworkInterception end # DriverExtensions diff --git a/rb/lib/selenium/webdriver/common/logger.rb b/rb/lib/selenium/webdriver/common/logger.rb index 318d4e3110ab5..810b87a8e3c31 100644 --- a/rb/lib/selenium/webdriver/common/logger.rb +++ b/rb/lib/selenium/webdriver/common/logger.rb @@ -193,7 +193,7 @@ def create_logger(name, level:) def discard_or_log(level, message, id) id = Array(id) - return if (@ignored & id).any? + return if @ignored.intersect?(id) return if @allowed.any? && (@allowed & id).none? return if ::Logger::Severity.const_get(level.upcase) < @logger.level diff --git a/rb/lib/selenium/webdriver/common/script.rb b/rb/lib/selenium/webdriver/common/script.rb index 4b58b1bbea2c7..a637b75f6bda1 100644 --- a/rb/lib/selenium/webdriver/common/script.rb +++ b/rb/lib/selenium/webdriver/common/script.rb @@ -25,13 +25,13 @@ def initialize(bridge) end # @return [int] id of the handler - def add_console_message_handler(&block) - @log_handler.add_message_handler('console', &block) + def add_console_message_handler(&) + @log_handler.add_message_handler('console', &) end # @return [int] id of the handler - def add_javascript_error_handler(&block) - @log_handler.add_message_handler('javascript', &block) + def add_javascript_error_handler(&) + @log_handler.add_message_handler('javascript', &) end # @param [int] id of the handler previously added diff --git a/rb/lib/selenium/webdriver/remote/bridge.rb b/rb/lib/selenium/webdriver/remote/bridge.rb index a26bb4bd1fe22..1678065010108 100644 --- a/rb/lib/selenium/webdriver/remote/bridge.rb +++ b/rb/lib/selenium/webdriver/remote/bridge.rb @@ -35,10 +35,10 @@ class << self attr_reader :extra_commands attr_writer :element_class, :locator_converter - def add_command(name, verb, url, &block) + def add_command(name, verb, url, &) @extra_commands ||= {} @extra_commands[name] = [verb, url] - define_method(name, &block) + define_method(name, &) end def locator_converter diff --git a/rb/lib/selenium/webdriver/support/guards.rb b/rb/lib/selenium/webdriver/support/guards.rb index ad5e1f2c9efd8..f56850106396d 100644 --- a/rb/lib/selenium/webdriver/support/guards.rb +++ b/rb/lib/selenium/webdriver/support/guards.rb @@ -37,8 +37,8 @@ def initialize(example, bug_tracker: '', conditions: nil) @messages = {} end - def add_condition(name, condition = nil, &blk) - @guard_conditions << GuardCondition.new(name, condition, &blk) + def add_condition(name, condition = nil, &) + @guard_conditions << GuardCondition.new(name, condition, &) end def add_message(name, message) diff --git a/rb/selenium-devtools.gemspec b/rb/selenium-devtools.gemspec index 455966163f019..709efc6bcdb2c 100644 --- a/rb/selenium-devtools.gemspec +++ b/rb/selenium-devtools.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |s| } s.required_rubygems_version = Gem::Requirement.new('> 1.3.1') if s.respond_to? :required_rubygems_version= - s.required_ruby_version = Gem::Requirement.new('>= 3.0') + s.required_ruby_version = Gem::Requirement.new('>= 3.1') s.files = [ 'LICENSE', diff --git a/rb/selenium-webdriver.gemspec b/rb/selenium-webdriver.gemspec index 64a92dcb358fc..b6c09f273c326 100644 --- a/rb/selenium-webdriver.gemspec +++ b/rb/selenium-webdriver.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |s| } s.required_rubygems_version = Gem::Requirement.new('> 1.3.1') if s.respond_to? :required_rubygems_version= - s.required_ruby_version = Gem::Requirement.new('>= 3.0') + s.required_ruby_version = Gem::Requirement.new('>= 3.1') s.files = [ 'CHANGES',