From fc86c8692293364fbd91cca7ebd8873c5e5ad80a Mon Sep 17 00:00:00 2001 From: titusfortner Date: Tue, 26 Dec 2023 11:38:03 -0500 Subject: [PATCH] [rb] bundle and rubocop updates --- rb/Gemfile.lock | 48 +++++++++---------- .../driver_extensions/has_log_events.rb | 2 +- rb/lib/selenium/webdriver/common/error.rb | 2 +- rb/lib/selenium/webdriver/common/options.rb | 2 +- rb/lib/selenium/webdriver/common/proxy.rb | 4 +- .../selenium/webdriver/remote/capabilities.rb | 2 +- rb/lib/selenium/webdriver/remote/features.rb | 2 +- .../webdriver/support/event_firing_bridge.rb | 4 +- .../spec_support/test_environment.rb | 4 +- 9 files changed, 35 insertions(+), 35 deletions(-) diff --git a/rb/Gemfile.lock b/rb/Gemfile.lock index c1f94afc83b55..40f8f6ceef81d 100644 --- a/rb/Gemfile.lock +++ b/rb/Gemfile.lock @@ -11,7 +11,7 @@ PATH GEM remote: https://rubygems.org/ specs: - abbrev (0.1.1) + abbrev (0.1.2) activesupport (7.1.2) base64 bigdecimal @@ -22,34 +22,34 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - addressable (2.8.5) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) base64 (0.2.0) - bigdecimal (3.1.4) + bigdecimal (3.1.5) concurrent-ruby (1.2.2) connection_pool (2.4.1) crack (0.4.5) rexml csv (3.2.8) - debug (1.8.0) - irb (>= 1.5.0) - reline (>= 0.3.1) + debug (1.9.1) + irb (~> 1.10) + reline (>= 0.3.8) diff-lcs (1.5.0) drb (2.2.0) ruby2_keywords ffi (1.16.3) ffi (1.16.3-x64-mingw32) fileutils (1.7.2) - hashdiff (1.0.1) + hashdiff (1.1.0) i18n (1.14.1) concurrent-ruby (~> 1.0) - io-console (0.6.0) - irb (1.9.0) + io-console (0.7.1) + irb (1.11.0) rdoc reline (>= 0.3.8) - json (2.6.3) - json (2.6.3-java) + json (2.7.1) + json (2.7.1-java) language_server-protocol (3.17.0.3) listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) @@ -57,11 +57,11 @@ GEM logger (1.6.0) minitest (5.20.0) mutex_m (0.2.0) - parallel (1.23.0) + parallel (1.24.0) parser (3.2.2.4) ast (~> 2.4.1) racc - psych (5.1.1.1) + psych (5.1.2) stringio public_suffix (5.0.4) racc (1.7.3) @@ -72,12 +72,12 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rbs (3.3.2) + rbs (3.4.1) abbrev - rdoc (6.6.0) + rdoc (6.6.2) psych (>= 4.0.0) - regexp_parser (2.8.2) - reline (0.4.0) + regexp_parser (2.8.3) + reline (0.4.1) io-console (~> 0.5) rexml (3.2.6) rspec (3.12.0) @@ -93,7 +93,7 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-support (3.12.1) - rubocop (1.57.2) + rubocop (1.59.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -101,7 +101,7 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.30.0) @@ -110,9 +110,9 @@ GEM rubocop (~> 1.41) rubocop-factory_bot (2.24.0) rubocop (~> 1.33) - rubocop-performance (1.19.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) + rubocop-performance (1.20.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) rubocop-rspec (2.25.0) rubocop (~> 1.40) rubocop-capybara (~> 2.17) @@ -120,7 +120,7 @@ GEM ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) - securerandom (0.3.0) + securerandom (0.3.1) steep (1.5.3) activesupport (>= 5.1) concurrent-ruby (>= 1.1.10) @@ -136,7 +136,7 @@ GEM securerandom (>= 0.1) strscan (>= 1.0.0) terminal-table (>= 2, < 4) - stringio (3.0.9) + stringio (3.1.0) strscan (3.0.7) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) diff --git a/rb/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb b/rb/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb index a3cdf442eb9cf..1965466633f08 100644 --- a/rb/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +++ b/rb/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb @@ -64,7 +64,7 @@ def on_log_event(kind, &block) return if enabled devtools.runtime.enable - __send__("log_#{kind}_events") + __send__(:"log_#{kind}_events") end private diff --git a/rb/lib/selenium/webdriver/common/error.rb b/rb/lib/selenium/webdriver/common/error.rb index e60af465b9cea..69adfe4e2fe35 100644 --- a/rb/lib/selenium/webdriver/common/error.rb +++ b/rb/lib/selenium/webdriver/common/error.rb @@ -29,7 +29,7 @@ def self.for_error(error) return if error.nil? klass_name = error.split.map(&:capitalize).join.sub(/Error$/, '') - const_get("#{klass_name}Error", false) + const_get(:"#{klass_name}Error", false) rescue NameError WebDriverError end diff --git a/rb/lib/selenium/webdriver/common/options.rb b/rb/lib/selenium/webdriver/common/options.rb index bf3b5a7bb9910..cfe900fe36a31 100644 --- a/rb/lib/selenium/webdriver/common/options.rb +++ b/rb/lib/selenium/webdriver/common/options.rb @@ -59,7 +59,7 @@ def set_capabilities @options[key] end - define_method "#{key}=" do |value| + define_method :"#{key}=" do |value| @options[key] = value end end diff --git a/rb/lib/selenium/webdriver/common/proxy.rb b/rb/lib/selenium/webdriver/common/proxy.rb index fd32711e0a632..9ea94c0dfb294 100644 --- a/rb/lib/selenium/webdriver/common/proxy.rb +++ b/rb/lib/selenium/webdriver/common/proxy.rb @@ -49,7 +49,7 @@ def self.json_create(data) proxy = new ALLOWED.each do |k, v| - proxy.send("#{k}=", data[v]) if data.key?(v) + proxy.send(:"#{k}=", data[v]) if data.key?(v) end proxy @@ -60,7 +60,7 @@ def initialize(opts = {}) opts.each do |k, v| if ALLOWED.key?(k) - send("#{k}=", v) + send(:"#{k}=", v) else not_allowed << k end diff --git a/rb/lib/selenium/webdriver/remote/capabilities.rb b/rb/lib/selenium/webdriver/remote/capabilities.rb index 74f079418c690..4bcac5e12c4bd 100644 --- a/rb/lib/selenium/webdriver/remote/capabilities.rb +++ b/rb/lib/selenium/webdriver/remote/capabilities.rb @@ -48,7 +48,7 @@ class Capabilities @capabilities[key] end - define_method "#{key}=" do |value| + define_method :"#{key}=" do |value| @capabilities[key] = value end end diff --git a/rb/lib/selenium/webdriver/remote/features.rb b/rb/lib/selenium/webdriver/remote/features.rb index 73f33d3eb588e..638ced4d60ed4 100644 --- a/rb/lib/selenium/webdriver/remote/features.rb +++ b/rb/lib/selenium/webdriver/remote/features.rb @@ -51,7 +51,7 @@ def upload(local_file) end def upload_if_necessary(keys) - local_files = keys.first&.split("\n")&.map { |key| @file_detector.call(Array(key)) }&.compact + local_files = keys.first&.split("\n")&.filter_map { |key| @file_detector.call(Array(key)) } return keys unless local_files&.any? keys = local_files.map { |local_file| upload(local_file) } diff --git a/rb/lib/selenium/webdriver/support/event_firing_bridge.rb b/rb/lib/selenium/webdriver/support/event_firing_bridge.rb index d82d4a4bfccb0..f793129494423 100644 --- a/rb/lib/selenium/webdriver/support/event_firing_bridge.rb +++ b/rb/lib/selenium/webdriver/support/event_firing_bridge.rb @@ -113,9 +113,9 @@ def driver end def dispatch(name, *args) - @listener.__send__("before_#{name}", *args) + @listener.__send__(:"before_#{name}", *args) returned = yield - @listener.__send__("after_#{name}", *args) + @listener.__send__(:"after_#{name}", *args) returned end diff --git a/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb b/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb index eb798d4ceab05..5ded602ad5093 100644 --- a/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb +++ b/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb @@ -142,7 +142,7 @@ def root def create_driver!(listener: nil, **opts, &block) check_for_previous_error - method = "#{driver}_driver".to_sym + method = :"#{driver}_driver" instance = if private_methods.include?(method) send(method, listener: listener, options: build_options(**opts)) else @@ -167,7 +167,7 @@ def create_driver!(listener: nil, **opts, &block) private def build_options(**opts) - options_method = "#{browser}_options".to_sym + options_method = :"#{browser}_options" if private_methods.include?(options_method) send(options_method, **opts) else