Class: Webkit
Direct Known Subclasses
Safari
Instance Method Summary
collapse
Methods inherited from Browser
#escaped_name, #host, #installed?, #linux?, #macos?, #name, #path, #runnable?, #to_s, #windows?
Constructor Details
#initialize(path = File.join(ENV['WEBKIT_HOME'] || ENV['ProgramFiles'] || 'C:\Program Files', 'Webkit', 'webkit.exe')) ⇒ Webkit
Returns a new instance of Webkit.
2
3
4
|
# File 'lib/hanoi/browsers/webkit.rb', line 2
def initialize(path = File.join(ENV['WEBKIT_HOME'] || ENV['ProgramFiles'] || 'C:\Program Files', 'Webkit', 'webkit.exe'))
@path = path
end
|
Instance Method Details
#setup ⇒ Object
10
11
12
|
# File 'lib/hanoi/browsers/webkit.rb', line 10
def setup
applescript(%(tell application "#{name}" to make new document)) if macos?
end
|
#supported? ⇒ Boolean
6
7
8
|
# File 'lib/hanoi/browsers/webkit.rb', line 6
def supported?
macos? || windows?
end
|
#teardown ⇒ Object
22
23
24
|
# File 'lib/hanoi/browsers/webkit.rb', line 22
def teardown
end
|
#visit(url) ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/hanoi/browsers/webkit.rb', line 14
def visit(url)
if macos?
applescript(%(tell application "#{name}" to set URL of front document to "#{url}"))
elsif windows?
system("#{path} #{url}")
end
end
|