Sha256: 805c245c7a6bd7a3a5caa2c7c4fd40f231361ded79d9817f68b48b3f972241ed

Contents?: true

Size: 1.99 KB

Versions: 5

Compression:

Stored size: 1.99 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]

  Recording:

    record          - record new shellcast

  Publishing:

    push last       - publish last record
    push RECORD_ID  - publish

  Getting record as json:

    dump last       - dump last record as json to current dir
    dump RECORD_ID  - dump any record as json to current dir

  Replaying:

    list            - print list of records
    play last       - play last local record
    play RECORD_ID  - play local record
    play RECORD_URL - play remote record
    play dump.json  - play local file dumped with `shelr dump`

  Setup:

    setup API_KEY   - set your API key
    backend [ttyrec|script] - setup recorder backend

  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:.*/ # remote file
      Shelr::Player.play_remote(ARGV[1])
    elsif ARGV[1] =~ /.*\.json$/ # local file
      Shelr::Player.play_dump(ARGV[1])
    end
  else
    puts "Missing id for shellcast"
    Shelr::Player.list
    puts "Select one..."
  end
when 'stop'
  puts '=> type "exit" or Ctrl+D'
  puts '=> Then `shelr push last`'
when 'dump'
  if ARGV[1]
    Shelr::Publisher.new.dump(ARGV[1])
  else
    puts "What do you want to dump?"
    Shelr::Player.list
    puts "Select one..."
  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..."
  end
when 'setup'
  if ARGV[1]
    Shelr.api_key = ARGV[1]
  else
    puts "\n\tUsage: #{BASENAME} setup API_KEY\n\n"
  end
when 'backend'
  if ARGV[1]
    Shelr.backend = ARGV[1]
  else
    puts "\n\tUsage: #{BASENAME} backend [ttyrec|script]\n\n"
  end
when 'version'
  puts Shelr::VERSION
else
  puts HELP
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
shelr-0.13.0 bin/shelr
shelr-0.12.9 bin/shelr
shelr-0.12.8 bin/shelr
shelr-0.12.7 bin/shelr
shelr-0.12.6 bin/shelr