s3copy 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/s3copy +7 -1
  2. data/s3copy.gemspec +1 -1
  3. metadata +5 -5
data/bin/s3copy CHANGED
@@ -26,7 +26,7 @@ else
26
26
  begin
27
27
  object = in_bucket.object(key)
28
28
  objects << object
29
- rescue Exception => e
29
+ rescue Exception => e
30
30
  puts "Failed to get key #{key} from input bucket: #{e.message}"
31
31
  end
32
32
  key = STDIN.gets
@@ -37,6 +37,12 @@ else
37
37
 
38
38
  # begin copy
39
39
  objects.each do |object|
40
+ begin
41
+ exists = out_bucket.object(key)
42
+ puts "Skipping key #{object.key} because it already exists."
43
+ next
44
+ rescue
45
+ end
40
46
  begin
41
47
  copy = out_bucket.objects.build(object.key)
42
48
  copy.content = object.content
data/s3copy.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "s3copy"
6
- s.version = "0.0.3"
6
+ s.version = "0.0.4"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Javier Muniz"]
9
9
  s.email = "javier@granicus.com"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3copy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-03 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: s3
16
- requirement: &2152633220 !ruby/object:Gem::Requirement
16
+ requirement: &2164769100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.3.11
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2152633220
24
+ version_requirements: *2164769100
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: s3
27
- requirement: &2152615040 !ruby/object:Gem::Requirement
27
+ requirement: &2164768620 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 0.3.11
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2152615040
35
+ version_requirements: *2164768620
36
36
  description: Simple library and command line tool for copying files between S3 buckets.
37
37
  email: javier@granicus.com
38
38
  executables: