class S3Repo::Base

Base object, used to provide common attributes

Public Class Methods

new(params = {}) click to toggle source
# File lib/s3repo/base.rb, line 7
def initialize(params = {})
  @options = params
end

Private Instance Methods

bucket() click to toggle source
# File lib/s3repo/base.rb, line 19
def bucket
  @options[:bucket] || raise('No bucket given')
end
client() click to toggle source
# File lib/s3repo/base.rb, line 23
def client
  @options[:client] ||= Client.new(@options)
end
file_cache() click to toggle source
# File lib/s3repo/base.rb, line 27
def file_cache
  @file_cache ||= @options[:file_cache] || Cache.new(@options)
end
run(cmd) click to toggle source
# File lib/s3repo/base.rb, line 13
def run(cmd)
  results = `#{cmd} 2>&1`
  return results if $CHILD_STATUS.success?
  raise "Failed running #{cmd}:\n#{results}"
end