Sha256: 330759ad06d00293ee78af0cfa113ff9fd1b082de1118ad5876fedc81c805a22

Contents?: true

Size: 1.95 KB

Versions: 7

Compression:

Stored size: 1.95 KB

Contents

#!/usr/bin/ruby

# = Rudy SDB
# 
# === A Rudy interface to Amazon Simple Storage Service
#
# 
# 
# See rudy-sdb -h for usage
# 

$:.unshift File.join(File.dirname(__FILE__), '..', 'lib') # Put our local lib in first place
$:.unshift File.join(File.dirname(__FILE__), '..', 'vendor', 'highline-1.5.1', 'lib')
#%w{amazon-ec2 caesars rye}.each { |dir| $:.unshift File.join(File.dirname(__FILE__), '..', '..', dir, 'lib') }
#require 'rubygems'

require 'rudy'
require 'rudy/cli'
require 'drydock'

# Command-line interface for bin/rudy-sdb
module RudyCLI_SDB
  extend Drydock
  
  # -----------------------------------  AMAZON SDB COMMANDS  --------
  # ------------------------------------------------------------------
  
  
  about "Displays the SimpleDB domains associated to your account"
  action :C, :create, "Create a domain"
  action :D, :destroy, "Destroy a domain"
  argv :name
  command :domains => Rudy::CLI::AWS::SDB::Domains
  
  
  # --------------------------------  RUDY-SDB MISCELLANEOUS  --------
  # ------------------------------------------------------------------
  
  default :domains
  debug :off
  
  
end


#puts Rudy::Utils.banner("THIS IS RUBY #{RUBY_VERSION}") if Drydock.debug?

# We call Drydock specifically otherwise it will run at_exit. Rye also
# uses at_exit for shutting down the ssh-agent. Ruby executes at_exit
# blocks in reverse order so if Drydock is required first, it's block
# will run after Rye shuts down the ssh-agent. 
begin
  Drydock.run!(ARGV, STDIN) if Drydock.run? && !Drydock.has_run?
rescue Drydock::ArgError, Drydock::OptError => ex
  STDERR.puts ex.message
  STDERR.puts ex.usage
rescue Drydock::InvalidArgument => ex
  STDERR.puts ex.message  
rescue Rudy::Error => ex
  STDERR.puts ex.message
  STDERR.puts ex.backtrace if Drydock.debug?
rescue => ex
  STDERR.puts "ERROR (#{ex.class.to_s}): #{ex.message}"
  STDERR.puts ex.backtrace if Drydock.debug?
rescue Interrupt
  puts "#{$/}Exiting... "
  exit 1
rescue SystemExit
  # Don't balk
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
solutious-rudy-0.7.0 bin/rudy-sdb
solutious-rudy-0.7.1 bin/rudy-sdb
solutious-rudy-0.7.2 bin/rudy-sdb
solutious-rudy-0.7.3 bin/rudy-sdb
rudy-0.7.0 bin/rudy-sdb
rudy-0.7.1 bin/rudy-sdb
rudy-0.7.3 bin/rudy-sdb