Skip to content

Commit

Permalink
rb: Add IE.driver_path accessor just like other drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed May 31, 2016
1 parent a151e56 commit c64a624
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
19 changes: 12 additions & 7 deletions rb/lib/selenium/webdriver/ie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,28 @@
# specific language governing permissions and limitations
# under the License.

require 'selenium/webdriver/ie/server'
require 'selenium/webdriver/ie/bridge'

module Selenium
module WebDriver

# @api private
module IE
MISSING_TEXT = "Unable to find standalone executable. Please download the IEDriverServer from http://selenium-release.storage.googleapis.com/index.html and place the executable on your PATH."

def self.driver_path=(path)
Platform.assert_executable path
@driver_path = path
end

def self.driver_path
@driver_path ||= nil
end
@driver_path ||= begin
path = Platform.find_binary("IEDriverServer")
path or raise Error::WebDriverError, MISSING_TEXT
Platform.assert_executable path

path
end
end
end # IE
end # WebDriver
end # Selenium

require 'selenium/webdriver/ie/server'
require 'selenium/webdriver/ie/bridge'
9 changes: 1 addition & 8 deletions rb/lib/selenium/webdriver/ie/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,9 @@ class Server

STOP_TIMEOUT = 5
SOCKET_LOCK_TIMEOUT = 45
MISSING_TEXT = "Unable to find standalone executable. Please download the IEDriverServer from http://selenium-release.storage.googleapis.com/index.html and place the executable on your PATH."

def self.get(opts = {})
binary = IE.driver_path || Platform.find_binary("IEDriverServer")

if binary
new binary, opts
else
raise Error::WebDriverError, MISSING_TEXT
end
new IE.driver_path, opts
end

attr_accessor :log_level, :log_file
Expand Down

0 comments on commit c64a624

Please sign in to comment.