class Deadpull::Commands::Pull

Public Instance Methods

call() click to toggle source
# File lib/deadpull/commands/pull.rb, line 12
def call
  ensure_target_is_not_a_file
  objects.each do |object|
    location = Values::LocalLocation.concretize(path, s3_locations.prefix, object.key)
    object.download_file(location)
  end
  true
end

Private Instance Methods

ensure_target_is_not_a_file() click to toggle source
# File lib/deadpull/commands/pull.rb, line 27
def ensure_target_is_not_a_file
  raise(ArgumentError, "#{path} is a regular file") if File.file?(path)
end
objects() click to toggle source
# File lib/deadpull/commands/pull.rb, line 23
def objects
  bucket.objects(prefix: s3_locations.prefix)
end