Class: Chrome

Inherits:
Browser show all
Defined in:
lib/hanoi/browsers/chrome.rb

Instance Method Summary collapse

Methods inherited from Browser

#escaped_name, #host, #linux?, #macos?, #open, #path, #setup, #teardown, #to_s, #visit, #windows?

Constructor Details

#initialize(path = nil) ⇒ Chrome

Returns a new instance of Chrome.



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/hanoi/browsers/chrome.rb', line 2

def initialize(path = nil)
  @path = path || File.join(
    ENV['UserPath'] || ENV['UserProfile'] || "C:/Documents and Settings/Administrator",
    "Local Settings",
    "Application Data",
    "Google",
    "Chrome",
    "Application",
    "chrome.exe"
  )
end

Instance Method Details

#nameObject



18
19
20
# File 'lib/hanoi/browsers/chrome.rb', line 18

def name
  "Google Chrome"
end

#supported?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/hanoi/browsers/chrome.rb', line 14

def supported?
  windows? || macos?
end