Skip to content

Commit

Permalink
[rb] deprecate passing in port to Remote Bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Feb 24, 2017
1 parent d00e91f commit 58d2253
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rb/lib/selenium/webdriver/remote/bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
6 changes: 6 additions & 0 deletions rb/lib/selenium/webdriver/remote/w3c_bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down

0 comments on commit 58d2253

Please sign in to comment.