s3snapshot 0.0.9 → 0.0.10a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/s3snapshot/dir_download.rb +11 -7
- data/lib/s3snapshot/version.rb +1 -1
- data/s3snapshot.gemspec +0 -0
- metadata +13 -10
@@ -47,11 +47,9 @@ module S3snapshot
|
|
47
47
|
prefix_path = timepath(@prefix, @time)
|
48
48
|
|
49
49
|
|
50
|
-
files.each do |
|
50
|
+
files.each do |remotefile|
|
51
51
|
#We have to reload state from s3. Otherwise we can't download when the restore process takes a while
|
52
|
-
|
53
|
-
|
54
|
-
destination_path = "#{@local_dir}/#{file.key[prefix_path.length+1..-1]}"
|
52
|
+
destination_path = "#{@local_dir}/#{remotefile.key[prefix_path.length+1..-1]}"
|
55
53
|
|
56
54
|
directory = destination_path[0..-File.basename(destination_path).length-1]
|
57
55
|
|
@@ -60,14 +58,20 @@ module S3snapshot
|
|
60
58
|
FileUtils.mkdir(directory)
|
61
59
|
end
|
62
60
|
|
63
|
-
puts "downloading '#{
|
61
|
+
puts "downloading '#{remotefile.key}' to '#{destination_path}'"
|
64
62
|
|
65
|
-
|
66
|
-
|
63
|
+
File.open(destination_path, File::RDWR|File::CREAT) do |file|
|
64
|
+
bucket.files.get(remotefile.key) do |chunk, remaining_bytes, total_bytes|
|
65
|
+
file.write(chunk)
|
66
|
+
percent = (1-remaining_bytes/total_bytes)*100
|
67
|
+
puts "#{percent}% complete"
|
68
|
+
end
|
69
|
+
end
|
67
70
|
|
68
71
|
end
|
69
72
|
|
70
73
|
|
74
|
+
|
71
75
|
puts "Writing complete marker"
|
72
76
|
|
73
77
|
|
data/lib/s3snapshot/version.rb
CHANGED
data/s3snapshot.gemspec
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 2
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
|
9
|
+
- 10
|
10
|
+
- a
|
11
|
+
version: 0.0.10a
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Todd
|
@@ -15,7 +16,7 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2011-
|
19
|
+
date: 2011-10-11 00:00:00 Z
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: fog
|
@@ -114,16 +115,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
116
|
none: false
|
116
117
|
requirements:
|
117
|
-
- - "
|
118
|
+
- - ">"
|
118
119
|
- !ruby/object:Gem::Version
|
119
|
-
hash:
|
120
|
+
hash: 25
|
120
121
|
segments:
|
121
|
-
-
|
122
|
-
|
122
|
+
- 1
|
123
|
+
- 3
|
124
|
+
- 1
|
125
|
+
version: 1.3.1
|
123
126
|
requirements: []
|
124
127
|
|
125
128
|
rubyforge_project: s3snapshot
|
126
|
-
rubygems_version: 1.8.
|
129
|
+
rubygems_version: 1.8.2
|
127
130
|
signing_key:
|
128
131
|
specification_version: 3
|
129
132
|
summary: Uploads to s3
|