Sha256: 813e3ca1833e1870aa3036fc8379be34bdf60a5ff0e7b9be5abebf93dac024f7

Contents?: true

Size: 326 Bytes

Versions: 1

Compression:

Stored size: 326 Bytes

Contents

class Controller
  def launch
    execute('launch')
  end

  def play
    execute('play')
  end

  def pause
    execute('pause')
  end

  private

  def execute(script_fragment)
    IO.popen('osascript -', 'w') do |f|
      f.write(<<SCRIPT)
tell application "Swinsian"
  #{script_fragment}
end tell
SCRIPT
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eventmachine-swinsian-0.0.1 spec/support/controller.rb