tori 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tori/backend/s3.rb +6 -6
- data/lib/tori/version.rb +1 -1
- data/test/test_tori_backend_s3.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 954188d945ed7e2571b4f9d3acb4658bf1b8d36a
|
4
|
+
data.tar.gz: e1b66fb27490fd05f5744efe1f8b1ffb5a78671f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e2ede21685e50eb023c0a8ddb7158ef55667832ab46d0a5638793ec563ea19e19821ad3649b057f81c0f7d6d14e133ede37cf18d94cb71c36d3f0745435ead6
|
7
|
+
data.tar.gz: efae86ba56f3864370475dc346dac71377f47034e60ab88db730ef02b8b2fa0ca90fe6f45e54f0515d722e7d2ce3ed0f26138f444f2e9ec3b91fc6b5a9d6da2e
|
data/lib/tori/backend/s3.rb
CHANGED
@@ -131,19 +131,19 @@ module Tori
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def open(filename)
|
134
|
-
|
135
|
-
|
134
|
+
blob = read(filename)
|
135
|
+
opt = [::File.basename(filename), ::File.extname(filename)]
|
136
136
|
|
137
137
|
if block_given?
|
138
|
-
Tempfile.create(
|
139
|
-
f.write
|
138
|
+
Tempfile.create(opt) do |f|
|
139
|
+
f.write blob
|
140
140
|
f.fsync
|
141
141
|
f.rewind
|
142
142
|
yield f
|
143
143
|
end
|
144
144
|
else
|
145
|
-
f = Tempfile.open(
|
146
|
-
f.write
|
145
|
+
f = Tempfile.open(opt)
|
146
|
+
f.write blob
|
147
147
|
f.fsync
|
148
148
|
f.rewind
|
149
149
|
f
|
data/lib/tori/version.rb
CHANGED
@@ -25,7 +25,6 @@ class TestToriBackendS3 < Test::Unit::TestCase
|
|
25
25
|
|
26
26
|
teardown do
|
27
27
|
FileUtils.rm_rf("test/tmp")
|
28
|
-
@backend.delete("testfile")
|
29
28
|
end
|
30
29
|
|
31
30
|
test "auto content_type" do
|
@@ -122,6 +121,12 @@ class TestToriBackendS3 < Test::Unit::TestCase
|
|
122
121
|
f = @backend.open("testfile")
|
123
122
|
assert_instance_of Tempfile, f
|
124
123
|
f.close!
|
124
|
+
|
125
|
+
@backend.write("path/to/file", @testfile_path)
|
126
|
+
@backend.open("path/to/file") do |f|
|
127
|
+
assert_instance_of File, f
|
128
|
+
path = f.path
|
129
|
+
end
|
125
130
|
end
|
126
131
|
end
|
127
132
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tori
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ksss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|