From 58d2253e483499c904635eea5af948fda68928f1 Mon Sep 17 00:00:00 2001 From: Titus Fortner Date: Fri, 24 Feb 2017 13:20:46 -0600 Subject: [PATCH] [rb] deprecate passing in port to Remote Bridge --- rb/lib/selenium/webdriver/remote/bridge.rb | 6 ++++++ rb/lib/selenium/webdriver/remote/w3c_bridge.rb | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/rb/lib/selenium/webdriver/remote/bridge.rb b/rb/lib/selenium/webdriver/remote/bridge.rb index 6190657b0ab8a..a41371eb3064e 100755 --- a/rb/lib/selenium/webdriver/remote/bridge.rb +++ b/rb/lib/selenium/webdriver/remote/bridge.rb @@ -39,7 +39,13 @@ class Bridge def initialize(opts = {}) opts = opts.dup + if opts.key?(:port) + warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze + [DEPRECATION] `:port` is deprecated. Use `:url` with full path + DEPRECATE + end port = opts.delete(:port) || 4444 + http_client = opts.delete(:http_client) { Http::Default.new } desired_capabilities = opts.delete(:desired_capabilities) { Capabilities.firefox } url = opts.delete(:url) { "http://#{Platform.localhost}:#{port}/wd/hub" } diff --git a/rb/lib/selenium/webdriver/remote/w3c_bridge.rb b/rb/lib/selenium/webdriver/remote/w3c_bridge.rb index 54facd9d170cf..fc4e25405f7b8 100755 --- a/rb/lib/selenium/webdriver/remote/w3c_bridge.rb +++ b/rb/lib/selenium/webdriver/remote/w3c_bridge.rb @@ -48,7 +48,13 @@ def initialize(opts = {}) opts = opts.dup + if opts.key?(:port) + warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze + [DEPRECATION] `:port` is deprecated. Use full url desired. + DEPRECATE + end port = opts.delete(:port) || 4444 + http_client = opts.delete(:http_client) { Http::Default.new } desired_capabilities = opts.delete(:desired_capabilities) { W3CCapabilities.firefox } url = opts.delete(:url) { "http://#{Platform.localhost}:#{port}/wd/hub" }