Module: ExceptionAlarm

Defined in:
lib/exception_alarm/mpg123.rb,
lib/exception_alarm/version.rb

Constant Summary collapse

PLAY_COMMAND =
'mpg123'
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.mpg123_install_commandObject



15
16
17
18
19
# File 'lib/exception_alarm/mpg123.rb', line 15

def self.mpg123_install_command
  return "brew install #{PLAY_COMMAND}" if OS.osx?
  return "apt-get install #{PLAY_COMMAND}" if OS.linux?
  return nil
end

.mpg123_not_foundObject



8
9
10
11
12
13
# File 'lib/exception_alarm/mpg123.rb', line 8

def self.mpg123_not_found
  m = "exception_alarm warning: #{PLAY_COMMAND} command not found! #{PLAY_COMMAND} is required to play the mp3 alarm file."
  ic = self.mpg123_install_command
  m += " Please install #{PLAY_COMMAND} with '#{ic}'" if ic
  return m
end