Sha256: edc62fdcf861ed8ae1495327be409a5b21cc7043f6fef91409438088c70676f7

Contents?: true

Size: 1.69 KB

Versions: 10

Compression:

Stored size: 1.69 KB

Contents

#!/usr/bin/ruby

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

$:.unshift File.join(File.dirname(__FILE__), '..', 'lib') # Put our local lib in first place

begin
  require 'drydock'
  require 'rudy'
  require 'rudy/cli'
rescue Interrupt
  exit
end

# Command-line interface for bin/rudy-s3
module RudyCLI_S3
  extend Drydock
  
  # ------------------------------------  AMAZON S3 COMMANDS  --------
  # ------------------------------------------------------------------
  
  about "Amazon S3 Buckets"
  usage "rudy-s3 buckets"
  option :l, :location, String, "Specify a bucket location. One of: us, eu"
  action :C, :create, "Create a bucket"
  action :D, :destroy, "Destroy a bucket"
  argv :name
  command :buckets => Rudy::CLI::AWS::S3::Buckets
  command_alias :buckets, :b

  #about "Amazon S3 Storage Interface"
  #usage "rudy-s3 store file-path"
  #option :b, :bucket, String, "Bucket name"
  #argv :path
  #command :store => Rudy::CLI::AWS::S3::Store
  #command_alias :store, :s

  
  
  # ---------------------------------  RUDY-S3 MISCELLANEOUS  --------
  # ------------------------------------------------------------------
  
  default :buckets
  
end


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
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rudy-0.9.8.020 bin/rudy-s3
rudy-0.9.8.019 bin/rudy-s3
rudy-0.9.8.018 bin/rudy-s3
rudy-0.9.8.017 bin/rudy-s3
rudy-0.9.8.016 bin/rudy-s3
rudy-0.9.8.015 bin/rudy-s3
rudy-0.9.8.014 bin/rudy-s3
rudy-0.9.8.013 bin/rudy-s3
rudy-0.9.8.012 bin/rudy-s3
rudy-0.9.8.011 bin/rudy-s3