module Cuegrowler

Constants

VERSION

Public Class Methods

main() click to toggle source
# File lib/cuegrowler.rb, line 141
    def main

      require 'docopt'

      doc = <<DOCOPT
Displays Growl notifications from .cue files based on current time in iTunes.

Usage:
  cuegrowler [<filename>]
  cuegrowler -h | --help

Options:
  -h, --help      Shows this screen.
  <filename>      The .cue filename. If specified, cuegrowler will read the
                  tracklist from this file. Otherwise, the tracklist is parsed
                  from the current podcast episode's descriptions.
DOCOPT

      opts = Docopt::docopt(doc)

      start opts["<filename>"]

    rescue Docopt::Exit => e

      puts e.message

    end
start(filename=nil) click to toggle source
# File lib/cuegrowler.rb, line 124
def start(filename=nil)

  player    = ITunes

  tracklist = if filename
                Tracklist::Cuesheet.new(filename)
              else
                Tracklist::ITunes.new
              end

  puts "\n== Cuegrowler is running! =="
  puts "Player:    #{player}"
  puts "Tracklist: #{tracklist}"
  Growler.new(player, tracklist).loop_forever!

end