shrine-gridfs 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shrine/storage/gridfs.rb +3 -1
- data/shrine-gridfs.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40029dc2286128d838be04dde1d227de560e22cc
|
4
|
+
data.tar.gz: 5c850d492b3dc515270f91464095f66b09d51259
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a30b8704d13c9e2cbd8dea14cee99330dfe5c29f4289a577c96516e873d0fe4a1cadc7d3aa139b955d6648295fd66aa9fe4000bfc9dc25773d50c1674b6489cd
|
7
|
+
data.tar.gz: eed7f6c8f1a7a85e67dff358cf7e5baf6d78c004c41de8feccb4c6d0b6d9a3d09681de241f062b47a6d41a4297e9751bd3d5f41990ffb075e49ab8d40f93463f
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "shrine"
|
2
2
|
require "mongo"
|
3
|
+
|
3
4
|
require "stringio"
|
4
5
|
|
5
6
|
class Shrine
|
@@ -29,8 +30,9 @@ class Shrine
|
|
29
30
|
end
|
30
31
|
|
31
32
|
def stream(id)
|
33
|
+
content_length = bucket.find(_id: bson_id(id)).first["length"]
|
32
34
|
bucket.open_download_stream(bson_id(id)) do |stream|
|
33
|
-
stream.each { |chunk| yield chunk }
|
35
|
+
stream.each { |chunk| yield chunk, content_length }
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
data/shrine-gridfs.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shrine-gridfs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shrine
|
@@ -122,3 +122,4 @@ signing_key:
|
|
122
122
|
specification_version: 4
|
123
123
|
summary: Provides Mongo GridFS storage for Shrine.
|
124
124
|
test_files: []
|
125
|
+
has_rdoc:
|