Module: PaulDixThundergod

Defined in:
lib/paul_dix_thundergod.rb

Constant Summary collapse

COMMANDS_TO_TRY =
%w[afplay play omxplayer]

Class Method Summary collapse

Class Method Details

.playObject



4
5
6
7
8
9
10
11
# File 'lib/paul_dix_thundergod.rb', line 4

def self.play
  COMMANDS_TO_TRY.each do |command|
    if system("which #{command}")
      `#{command} #{File.dirname(__FILE__)}/paul_dix_thundergod/support/deploy_sound.mp3 &`
      break
    end
  end
end

.rollbackObject



13
14
15
16
17
18
19
20
# File 'lib/paul_dix_thundergod.rb', line 13

def self.rollback
  COMMANDS_TO_TRY.each do |command|
    if system("which #{command}")
      `#{command} #{File.dirname(__FILE__)}/paul_dix_thundergod/support/rollback_sound.mp3 &`
      break
    end
  end
end