Class: Sprout::System::OSXSystem

Inherits:
UnixSystem show all
Defined in:
lib/flashplayer/system_mixins.rb

Instance Method Summary collapse

Methods inherited from UnixSystem

#should_repair_executable

Instance Method Details

#open_flashplayer_with(exe, swf) ⇒ Object

Use AppleScript to open the specified Flash Player because, simply launching the executable does not focus it.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/flashplayer/system_mixins.rb', line 21

def open_flashplayer_with exe, swf
  # Clean paths differently for this exectuable,
  # because we're forking out to AppleScript over
  # a new process, and spaces need to be escaped.
  @player_exe = exe.split(' ').join('\ ')

  wrapper = []
  wrapper << "osascript"
  wrapper << open_flashplayer_script_path
  wrapper << @player_exe

  # Call the UnixSystem.open_flashplayer_with method:
  super wrapper.join(" "), File.expand_path(swf)
end