Module: JimmyJukebox

Defined in:
lib/jimmy_jukebox/song.rb,
lib/jimmy_jukebox/jukebox.rb,
lib/jimmy_jukebox/version.rb,
lib/jimmy_jukebox/constants.rb,
lib/jimmy_jukebox/song_loader.rb,
lib/jimmy_jukebox/user_config.rb,
lib/jimmy_jukebox/display_options.rb,
lib/jimmy_jukebox/user_input_handler.rb,
lib/jimmy_jukebox/music_player_detector.rb,
lib/jimmy_jukebox/handle_load_jukebox_input.rb

Defined Under Namespace

Modules: DisplayOptions, HandleLoadJukeboxInput Classes: Jukebox, MusicPlayerDetector, Song, SongLoader, UserConfig, UserInputHandler

Constant Summary collapse

VERSION =
'0.7.0'
DATE =
'2015-08-23'
AUDIO_FORMATS =
{/\.mp3$/i => 'mp3',
/\.ogg$/i => 'ogg',
/\.wav$/i => 'wav',
/.flac$/i => 'flac'}
HOST_OS =
RbConfig::CONFIG['host_os']
RUNNING_OSX =
HOST_OS =~ /darwin/i || HOST_OS =~ /mac os/i
RUNNING_JRUBY =
defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby') || RUBY_PLATFORM == 'java'
RUNNING_LINUX =
HOST_OS =~ /linux/i
RUNNING_X_WINDOWS =
!RUNNING_OSX && running_x_windows

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.running_x_windowsObject



14
15
16
17
18
19
20
21
# File 'lib/jimmy_jukebox/user_config.rb', line 14

def self.running_x_windows
  xset_location = `which xset`
  if xset_location
    !!xset_location.match(/\/xset/)
  else
    false
  end
end

Instance Method Details

#run_command(command, arg) ⇒ Object



149
150
151
152
153
# File 'lib/jimmy_jukebox/song.rb', line 149

def run_command(command, arg)
  # make system call and get pid so you can pause/terminate process
  pid = spawn_method.call(command, arg)
  self.playing_pid = pid
end