Sha256: 13c4d3e9a24cc091eb21d2b3412388399dcc096ea749bf07f3f1a66a844ebb6c

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

#!/usr/bin/env ruby

$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))

require 'rubygems'
require 'shelr'

BASENAME = File.basename(__FILE__)
HELP     = <<-HELP

  Usage: #{BASENAME} command [arg]
    
  Commands:
    setup API_KEY   - setup
    record          - record new shellcast
    push RECORD_ID  - publish
    list            - print list of records
    play RECORD_ID  - play local record
    play RECORD_URL - play remote record

  Visit: http://shelr.tv/ for more info.

HELP

case ARGV[0]
when '-h', '--help'
  puts HELP
when 'record'
	Shelr::Recorder.record!
when 'list'
  Shelr::Player.list
when 'play'
  if ARGV[1]
    if ARGV[1] =~ /^http:.*/
      Shelr::Player.play_remote(ARGV[1])
    else
      Shelr::Player.play(ARGV[1])
    end
  else
    puts "Missing id for shellcast"
    Shelr::Player.list
    puts "Select one..."
    exit
  end
when 'push'
  if ARGV[1]
    Shelr::Publisher.new.publish(ARGV[1])
  else
    puts "What do you want to publish?"
    Shelr::Player.list
    puts "Select one..."
    exit
  end
when 'setup'
  if ARGV[1]
    Shelr.api_key = ARGV[1]
  else
    puts "\n\tUsage: #{BASENAME} setup API_KEY\n\n"
    exit
  end
else
  puts HELP
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
shelr-0.9.10 bin/shelr
shelr-0.9.9 bin/shelr
shelr-0.9.8 bin/shelr
shelr-0.9.7 bin/shelr