module Honk

Constants

HONK

Public Instance Methods

call() click to toggle source
# File lib/honk.rb, line 6
def call
  if run_quietly('which afplay')
    run_quietly("afplay #{HONK}")
  elsif run_quietly('which mplayer')
    run_quietly("mplayer #{HONK}")
  else
    raise "No `afplay` or `mplayer` executable"
  end
end
run_quietly(command) click to toggle source
# File lib/honk.rb, line 16
def run_quietly(command)
  system(command, out: '/dev/null', err: '/dev/null')
end