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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da06eed7aefecd6c1a93ecc13aa940c11ebdc1b6
4
- data.tar.gz: 095deaa57d6d8ac0f6f91fde433dcb8f37112443
3
+ metadata.gz: 954188d945ed7e2571b4f9d3acb4658bf1b8d36a
4
+ data.tar.gz: e1b66fb27490fd05f5744efe1f8b1ffb5a78671f
5
5
  SHA512:
6
- metadata.gz: ba156535d1288ff070d8211ae5caf6d8cd0760fecf3382ed2e49f3839865d9341ab913693b3d2c066a8a1f036b6f81bfc185efc45ce27a1dba03348b82760882
7
- data.tar.gz: f23d6e28c92d609875dc3fa99d36cacd5edc9bde2254b4e0b9d00a225ba92abe6ff7bc9391f52e9f06ebe55f5eecc6533d807a22e451963401c55b5315d439f5
6
+ metadata.gz: 2e2ede21685e50eb023c0a8ddb7158ef55667832ab46d0a5638793ec563ea19e19821ad3649b057f81c0f7d6d14e133ede37cf18d94cb71c36d3f0745435ead6
7
+ data.tar.gz: efae86ba56f3864370475dc346dac71377f47034e60ab88db730ef02b8b2fa0ca90fe6f45e54f0515d722e7d2ce3ed0f26138f444f2e9ec3b91fc6b5a9d6da2e
@@ -131,19 +131,19 @@ module Tori
131
131
  end
132
132
 
133
133
  def open(filename)
134
- ext = ::File.extname(filename)
135
- body = body(filename)
134
+ blob = read(filename)
135
+ opt = [::File.basename(filename), ::File.extname(filename)]
136
136
 
137
137
  if block_given?
138
- Tempfile.create([filename, ext]) do |f|
139
- f.write body
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([filename, ext])
146
- f.write body
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
@@ -1,3 +1,3 @@
1
1
  module Tori
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -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.0
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-09 00:00:00.000000000 Z
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