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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8400f6c26ba70f76d11964c5050f6b3c12dfe996
4
- data.tar.gz: d1c65a66f5df7fb0c28299d3537d063ff0dca866
3
+ metadata.gz: 40029dc2286128d838be04dde1d227de560e22cc
4
+ data.tar.gz: 5c850d492b3dc515270f91464095f66b09d51259
5
5
  SHA512:
6
- metadata.gz: f21a39f94f699de24d51ff7ce6094cc4634d95cdf599a762c720af072834e830abf4f175c202786718f4b156cc8d77e42d3d775bc1e78742b68b1feb89c30a11
7
- data.tar.gz: 5ac97a6f1b7c1698420592844cc78104e70ddbff8d2c6a2b41891fa27bffecba39425a9ea68b8bb9b1b6879333f7973e2b70c1f09269ee8ba9a237beaa1282e8
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
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "shrine-gridfs"
3
- gem.version = "0.1.2"
3
+ gem.version = "0.1.3"
4
4
 
5
5
  gem.required_ruby_version = ">= 2.1"
6
6
 
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.2
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-03-10 00:00:00.000000000 Z
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: