Class: KeynoteDriver::Presentation
- Inherits:
-
Object
- Object
- KeynoteDriver::Presentation
- Defined in:
- lib/keynote_driver/presentation.rb
Instance Method Summary collapse
- #exec(delays) ⇒ Object
-
#initialize(path) ⇒ Presentation
constructor
A new instance of Presentation.
- #load_file_in_keynote ⇒ Object
Constructor Details
#initialize(path) ⇒ Presentation
Returns a new instance of Presentation.
5 6 7 8 9 10 11 |
# File 'lib/keynote_driver/presentation.rb', line 5 def initialize(path) if not File.exists?(path) raise PresentationException.new("#{path} doesn't exists.") end @path = path end |
Instance Method Details
#exec(delays) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/keynote_driver/presentation.rb', line 20 def exec(delays) load_file_in_keynote begin @system.processes['Keynote'].[1].[10]..[3].click rescue Appscript::CommandError retry end delays.each do |delay| Kernel.sleep(delay) @app.show_next end @app. end |
#load_file_in_keynote ⇒ Object
13 14 15 16 17 18 |
# File 'lib/keynote_driver/presentation.rb', line 13 def load_file_in_keynote @system = find_system @app = find_keynote @app.activate @app.open(@path) end |