Skip to content

Commit 07178f1

Browse files
committed
[rb] remove deprecations for setting driver path by module method
1 parent 4319d0a commit 07178f1

File tree

13 files changed

+28
-90
lines changed

13 files changed

+28
-90
lines changed

rb/lib/selenium/webdriver/chrome.rb

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,11 @@ module Selenium
2727
module WebDriver
2828
module Chrome
2929
def self.driver_path=(path)
30-
warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze
31-
[DEPRECATION] `driver_path=` is deprecated. Pass the driver path as an option instead.
32-
e.g. Selenium::WebDriver.for :chrome, driver_path: '/path'
33-
DEPRECATE
34-
3530
Platform.assert_executable path
3631
@driver_path = path
3732
end
3833

39-
def self.driver_path(warning = true)
40-
if warning
41-
warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze
42-
[DEPRECATION] `driver_path` is deprecated. Pass the driver path as an option instead.
43-
e.g. Selenium::WebDriver.for :chrome, driver_path: '/path'
44-
DEPRECATE
45-
end
46-
34+
def self.driver_path
4735
@driver_path ||= nil
4836
end
4937

rb/lib/selenium/webdriver/chrome/bridge.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def initialize(opts = {})
3131
end
3232

3333
unless opts.key?(:url)
34-
driver_path = opts.delete(:driver_path) || Chrome.driver_path(false)
34+
driver_path = opts.delete(:driver_path) || Chrome.driver_path
3535
@service = Service.new(driver_path, port, *extract_service_args(service_args))
3636
@service.start
3737
opts[:url] = @service.uri

rb/lib/selenium/webdriver/edge.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,11 @@ module Selenium
2626
module WebDriver
2727
module Edge
2828
def self.driver_path=(path)
29-
warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze
30-
[DEPRECATION] `driver_path=` is deprecated. Pass the driver path as an option instead.
31-
e.g. Selenium::WebDriver.for :edge, driver_path: '/path'
32-
DEPRECATE
33-
3429
Platform.assert_executable path
3530
@driver_path = path
3631
end
3732

3833
def self.driver_path(warning = true)
39-
if warning
40-
warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze
41-
[DEPRECATION] `driver_path` is deprecated. Pass the driver path as an option instead.
42-
e.g. Selenium::WebDriver.for :edge, driver_path: '/path'
43-
DEPRECATE
44-
end
45-
4634
@driver_path ||= nil
4735
end
4836
end # Edge

rb/lib/selenium/webdriver/edge/bridge.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def initialize(opts = {})
3030
service_args = opts.delete(:service_args) || {}
3131

3232
unless opts.key?(:url)
33-
driver_path = opts.delete(:driver_path) || Edge.driver_path(false)
33+
driver_path = opts.delete(:driver_path) || Edge.driver_path
3434
@service = Service.new(driver_path, port, *extract_service_args(service_args))
3535
@service.host = 'localhost' if @service.host == '127.0.0.1'
3636
@service.start

rb/lib/selenium/webdriver/firefox.rb

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,11 @@ module Firefox
4242
DEFAULT_LOAD_NO_FOCUS_LIB = false
4343

4444
def self.driver_path=(path)
45-
warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze
46-
[DEPRECATION] `driver_path=` is deprecated. Pass the driver path as an option instead.
47-
e.g. Selenium::WebDriver.for :firefox, driver_path: '/path'
48-
DEPRECATE
49-
5045
Platform.assert_executable path
5146
@driver_path = path
5247
end
5348

54-
def self.driver_path(warning = true)
55-
if warning
56-
warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze
57-
[DEPRECATION] `driver_path` is deprecated. Pass the driver path as an option instead.
58-
e.g. Selenium::WebDriver.for :firefox, driver_path: '/path'
59-
DEPRECATE
60-
end
61-
49+
def self.driver_path
6250
@driver_path ||= nil
6351
end
6452

rb/lib/selenium/webdriver/firefox/w3c_bridge.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def initialize(opts = {})
2727
opts[:desired_capabilities] = create_capabilities(opts)
2828
service_args = opts.delete(:service_args) || {}
2929

30-
driver_path = opts.delete(:driver_path) || Firefox.driver_path(false)
30+
driver_path = opts.delete(:driver_path) || Firefox.driver_path
3131
@service = Service.new(driver_path, port, *extract_service_args(service_args))
3232
@service.start
3333
opts[:url] = @service.uri

rb/lib/selenium/webdriver/ie.rb

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,11 @@ module Selenium
2424
module WebDriver
2525
module IE
2626
def self.driver_path=(path)
27-
warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze
28-
[DEPRECATION] `driver_path=` is deprecated. Pass the driver path as an option instead.
29-
e.g. Selenium::WebDriver.for :ie, driver_path: '/path'
30-
DEPRECATE
31-
3227
Platform.assert_executable path
3328
@driver_path = path
3429
end
3530

36-
def self.driver_path(warning = true)
37-
if warning
38-
warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze
39-
[DEPRECATION] `driver_path` is deprecated. Pass the driver path as an option instead.
40-
e.g. Selenium::WebDriver.for :ie, driver_path: '/path'
41-
DEPRECATE
42-
end
43-
31+
def self.driver_path
4432
@driver_path ||= nil
4533
end
4634
end # IE

rb/lib/selenium/webdriver/ie/bridge.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def initialize(opts = {})
2929
port = opts.delete(:port) || Service::DEFAULT_PORT
3030
service_args = opts.delete(:service_args) || {}
3131
service_args = match_legacy(opts, service_args)
32-
driver_path = opts.delete(:driver_path) || IE.driver_path(false)
32+
driver_path = opts.delete(:driver_path) || IE.driver_path
3333

3434
@service = Service.new(driver_path, port, *extract_service_args(service_args))
3535
@service.start

rb/lib/selenium/webdriver/phantomjs.rb

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,17 @@
2525
module Selenium
2626
module WebDriver
2727
module PhantomJS
28-
def self.path=(path)
29-
warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze
30-
[DEPRECATION] `path=` is deprecated. Pass the driver path as an option instead.
31-
e.g. Selenium::WebDriver.for :phantomjs, driver_path: '/path'
32-
DEPRECATE
33-
34-
Platform.assert_executable path
35-
@path = path
36-
end
37-
38-
def self.path(warning = true)
39-
if warning
40-
warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze
41-
[DEPRECATION] `path` is deprecated. Pass the driver path as an option instead.
42-
e.g. Selenium::WebDriver.for :phantomjs, driver_path: '/path'
43-
DEPRECATE
28+
class << self
29+
def path=(path)
30+
Platform.assert_executable path
31+
@path = path
4432
end
33+
alias_method :driver_path=, :path=
4534

46-
@path ||= nil
35+
def path
36+
@path ||= nil
37+
end
38+
alias_method :driver_path, :path
4739
end
4840
end # PhantomJS
4941
end # WebDriver

rb/lib/selenium/webdriver/phantomjs/bridge.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def initialize(opts = {})
3030
opts[:desired_capabilities] ||= Remote::Capabilities.phantomjs
3131

3232
unless opts.key?(:url)
33-
driver_path = opts.delete(:driver_path) || PhantomJS.path(false)
33+
driver_path = opts.delete(:driver_path) || PhantomJS.path
3434
args = opts.delete(:args) || opts[:desired_capabilities]['phantomjs.cli.args']
3535
@service = Service.new(driver_path, port, *args)
3636
@service.start

0 commit comments

Comments
 (0)