Module: GenericActions
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args) ⇒ Object
blindly pass on unrecognized methods to the appscript proxy
31
32
33
|
# File 'lib/generic_application.rb', line 31
def method_missing(meth, *args)
app.send(meth, *args)
end
|
Instance Method Details
#close_all_windows ⇒ Object
4
5
6
|
# File 'lib/generic_application.rb', line 4
def close_all_windows
app.windows.close
end
|
#ensure_launched ⇒ Object
19
20
21
22
23
24
|
# File 'lib/generic_application.rb', line 19
def ensure_launched
unless is_running?
app.launch
wait_for_me!
end
end
|
#keystroke(*args) ⇒ Object
26
27
28
|
# File 'lib/generic_application.rb', line 26
def keystroke(*args)
OSX[name].keystroke(*args)
end
|
#minimize_all_windows ⇒ Object
8
9
10
11
12
13
|
# File 'lib/generic_application.rb', line 8
def minimize_all_windows
app.activate
app.windows.get.select { |w| w.visible.get }.each do |window|
window.miniaturized.set(true)
end
end
|
#wait_for_me! ⇒ Object
15
16
17
|
# File 'lib/generic_application.rb', line 15
def wait_for_me!
sleep(0.1) while !is_running?
end
|