Sha256: 843f60385271cb8bceb4a44fe6adfc21fd50eeec66fbe6f80a190af64f3badeb

Contents?: true

Size: 1.08 KB

Versions: 21

Compression:

Stored size: 1.08 KB

Contents

#!/usr/bin/env ruby

require 't'

# Output message to $stderr, prefixed with the program name
def pute(message="")
  $stderr.puts "#{$0}: #{message}"
end

begin
  T::CLI.start(ARGV)
rescue Interrupt
  pute "Quitting..."
  exit 1
rescue Twitter::Error::BadRequest => error
  pute error.message
  exit 400
rescue OAuth::Unauthorized
  pute "Authorization failed"
  exit 401
rescue Twitter::Error::Unauthorized => error
  pute "#{error.message} Run `#{$0} authorize --consumer-key=CONSUMER_KEY --consumer-secret=CONSUMER_SECRET` to authorize."
  exit 401
rescue Twitter::Error::Forbidden => error
  pute error.message
  exit 403
rescue Twitter::Error::NotFound => error
  pute error.message
  exit 404
rescue Twitter::Error::NotAcceptable => error
  pute error.message
  exit 406
rescue Twitter::Error::EnhanceYourCalm => error
  pute error.message
  exit 420
rescue Twitter::Error::InternalServerError => error
  pute error.message
  exit 500
rescue Twitter::Error::BadGateway => error
  pute error.message
  exit 502
rescue Twitter::Error::ServiceUnavailable => error
  pute error.message
  exit 503
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
t-0.9.6 bin/t
t-0.9.5 bin/t
t-0.9.4 bin/t
t-0.9.3 bin/t
t-0.9.2 bin/t
t-0.9.1 bin/t
t-0.9.0 bin/t
t-0.8.3 bin/t
t-0.8.2 bin/t
t-0.8.1 bin/t
t-0.8.0 bin/t
t-0.7.0 bin/t
t-0.6.4 bin/t
t-0.6.3 bin/t
t-0.6.2 bin/t
t-0.6.1 bin/t
t-0.6.0 bin/t
t-0.5.1 bin/t
t-0.5.0 bin/t
t-0.4.0 bin/t