From 5148e83b7bb8570c532afaba21117c5ccc14eb23 Mon Sep 17 00:00:00 2001 From: Alex Rodionov Date: Thu, 25 Apr 2024 14:17:28 -0700 Subject: [PATCH] [rb] Return and deprecate DriverFinder.path This was accidentally removed in #13386. Fixes #13876. Related to rails/rails#51658. --- rb/lib/selenium/webdriver/common/driver_finder.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rb/lib/selenium/webdriver/common/driver_finder.rb b/rb/lib/selenium/webdriver/common/driver_finder.rb index 3f5aa4a1af648..9713ceb7ab63d 100644 --- a/rb/lib/selenium/webdriver/common/driver_finder.rb +++ b/rb/lib/selenium/webdriver/common/driver_finder.rb @@ -20,6 +20,11 @@ module Selenium module WebDriver class DriverFinder + def self.path(options, service) + WebDriver.logger.deprecate('DriverFinder.path', 'DriverFinder.new.driver_path') + new(options, service).driver_path + end + def initialize(options, service) @options = options @service = service @@ -41,9 +46,9 @@ def browser_path? def paths @paths ||= begin - path = @service.class.driver_path + path = @service.driver_path path = path.call if path.is_a?(Proc) - exe = @service.class::EXECUTABLE + exe = @service::EXECUTABLE if path WebDriver.logger.debug("Skipping Selenium Manager; path to #{exe} specified in service class: #{path}") Platform.assert_executable(path)