shrine-gridfs 0.4.1 → 1.0.0

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
  SHA256:
3
- metadata.gz: 30d8726432f89beab86ef65dd69c3a7c8507f6c129cedc084262466835536e85
4
- data.tar.gz: 700033084d915802acb2d87a293d3caa0dedea1349f67e020bec605a9b8173cf
3
+ metadata.gz: db43a823170c12ce633f872626b8b0340b374aeb98df4e7745cce15ee8c88eb5
4
+ data.tar.gz: b0bbb49b419ad0d27e4b0d47c3b58283642e723511fd187c69ad2f01d2695f8e
5
5
  SHA512:
6
- metadata.gz: 77dc9415814119d35aa0d3cea30757d6b9b110d076219447a39e928867960c9bdef265b6cd498acfbc6fce6b8e3cbeba13298aef8b4635351f6c63318f6e131e
7
- data.tar.gz: f6182850b80fe754767e0a0bdf13b2a44e0b98870aa6062e6896b85852e9e1d40b45e98e7f50e65aadbe3c4774e83a8c471af934ed0c5975ea43ac7c9fc11d7e
6
+ metadata.gz: bd973e36c531803ac2cd44643e18e1674c85111d083907290fa9d2a8fc7a24bc3063715fdfb70b3937a1eca555daa24e7661842708d73844f5d97576b8674c1e
7
+ data.tar.gz: 89bc7a9d11576dff9699fa36b174d5527c416336a95fbaab3fc3060f172aaae1ab095474efd8965ce8f959fde79a6ae6adf29a9e8153b25b443435a2e40b2d14
data/README.md CHANGED
@@ -8,7 +8,8 @@ convenient when MongoDB is already used in the application.
8
8
  ## Installation
9
9
 
10
10
  ```ruby
11
- gem 'shrine-gridfs'
11
+ # Gemfile
12
+ gem "shrine-gridfs", "~> 1.0"
12
13
  ```
13
14
 
14
15
  ## Usage
@@ -27,11 +27,11 @@ class Shrine
27
27
  end
28
28
 
29
29
  def open(id, rewindable: true, **)
30
- content_length = file_info(id)[:length]
30
+ info = file_info(id) or raise Shrine::FileNotFound, "file #{id.inspect} not found on storage"
31
31
  stream = bucket.open_download_stream(bson_id(id))
32
32
 
33
33
  Down::ChunkedIO.new(
34
- size: content_length,
34
+ size: info[:length],
35
35
  chunks: stream.enum_for(:each),
36
36
  on_close: -> { stream.close },
37
37
  rewindable: rewindable,
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "shrine-gridfs"
3
- gem.version = "0.4.1"
3
+ gem.version = "1.0.0"
4
4
 
5
5
  gem.required_ruby_version = ">= 2.1"
6
6
 
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.files = Dir["README.md", "LICENSE.txt", "lib/**/*.rb", "shrine-gridfs.gemspec"]
14
14
  gem.require_path = "lib"
15
15
 
16
- gem.add_dependency "shrine", ">= 2.2", "< 4"
16
+ gem.add_dependency "shrine", ">= 3.0.0.beta3", "< 4"
17
17
  gem.add_dependency "mongo", ">= 2.2.2", "< 3"
18
18
  gem.add_dependency "down", "~> 4.0"
19
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shrine-gridfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '2.2'
19
+ version: 3.0.0.beta3
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '4'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '2.2'
29
+ version: 3.0.0.beta3
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '4'