shrine-tus 2.0.0 → 2.1.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: d3b9a750cdf52cbc0f84641e08b508500fa7443f33505b2736ead57685654c24
4
- data.tar.gz: 7c49ff4133fd86f38034b260579a98934d4037b53205227d92ec8bb45b57666b
3
+ metadata.gz: d0e37e19e2990440589f8c19976e7dc43cc012387da17ff854ba1226544e1cca
4
+ data.tar.gz: 07e70c10ec9c197c1445b0a6cf78f360e6504123ab1d06cd4b1dc63ddc1547ff
5
5
  SHA512:
6
- metadata.gz: 007c7034718f1ce19fafb0c34ee831b7e6d5ea9b301c09e2a8462b4c80eff3c77d76d38c1ae497525977a67b447243fb31da0dd31a81bade0efbd5f80dfb86f1
7
- data.tar.gz: 04f5ef1a90889437a86c2bedba87ab124a9bbb3ca05a7d291b60cef05b0c6fd4b7bafce03ee0f98a29ba91f5aeed42bfe5616817e84d54c07c2892c572820c08
6
+ metadata.gz: 7cbbd7a375dcd729c2bffa9bbdbc9c1a3a8be76df8610f3ff22407fc71d275e2a84ae91e7d122d7b0e28299477b383ee43a9ae578a3501d9e8c2589d82ad4c5f
7
+ data.tar.gz: d954736334bd4b2d1ad6f55ee87f294d15b086af054ebbdc45be60510429dfd36a0e88b12c34323f2eb851750f43c5320dfee02468763408b553cd9a7d3f1b9d
@@ -14,24 +14,24 @@ class Shrine
14
14
  end
15
15
 
16
16
  def open(id, **options)
17
- if tus_storage
18
- open_from_tus_storage(tus_uid(id), **options)
19
- else
20
- super
21
- end
17
+ return super unless tus_storage
18
+
19
+ open_from_tus_storage(tus_uid(id), **options)
20
+ rescue ::Tus::NotFound
21
+ raise Shrine::FileNotFound, "file #{id.inspect} not found on storage"
22
22
  end
23
23
 
24
24
  private
25
25
 
26
26
  def open_from_tus_storage(uid, rewindable: true, **)
27
- response = get_tus_file(uid)
28
27
  info = get_tus_info(uid)
28
+ response = get_tus_file(uid)
29
29
 
30
30
  Down::ChunkedIO.new(
31
31
  size: Integer(info["Upload-Length"]),
32
32
  chunks: response.each,
33
33
  on_close: response.method(:close),
34
- rewindable: rewindable
34
+ rewindable: rewindable,
35
35
  )
36
36
  end
37
37
 
data/shrine-tus.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "shrine-tus"
3
- gem.version = "2.0.0"
3
+ gem.version = "2.1.0"
4
4
 
5
5
  gem.required_ruby_version = ">= 2.1"
6
6
 
@@ -13,13 +13,13 @@ Gem::Specification.new do |gem|
13
13
  gem.files = Dir["README.md", "LICENSE.txt", "lib/**/*.rb", "*.gemspec"]
14
14
  gem.require_path = "lib"
15
15
 
16
- gem.add_dependency "shrine", ">= 3.0.0.beta3", "< 4"
16
+ gem.add_dependency "shrine", ">= 3.0.0.rc", "< 4"
17
17
  gem.add_dependency "tus-server", "~> 2.0"
18
- gem.add_dependency "shrine-url", ">= 2.2.1", "< 3"
18
+ gem.add_dependency "shrine-url", "~> 2.4"
19
19
 
20
20
  gem.add_development_dependency "rake"
21
21
  gem.add_development_dependency "minitest"
22
22
  gem.add_development_dependency "webmock"
23
- gem.add_development_dependency "shrine-gridfs"
23
+ gem.add_development_dependency "shrine-gridfs", "~> 1.0"
24
24
  gem.add_development_dependency "aws-sdk-s3", "~> 1.14"
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shrine-tus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-25 00:00:00.000000000 Z
11
+ date: 2019-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shrine
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.0.beta3
19
+ version: 3.0.0.rc
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: 3.0.0.beta3
29
+ version: 3.0.0.rc
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '4'
@@ -48,22 +48,16 @@ dependencies:
48
48
  name: shrine-url
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: 2.2.1
54
- - - "<"
51
+ - - "~>"
55
52
  - !ruby/object:Gem::Version
56
- version: '3'
53
+ version: '2.4'
57
54
  type: :runtime
58
55
  prerelease: false
59
56
  version_requirements: !ruby/object:Gem::Requirement
60
57
  requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: 2.2.1
64
- - - "<"
58
+ - - "~>"
65
59
  - !ruby/object:Gem::Version
66
- version: '3'
60
+ version: '2.4'
67
61
  - !ruby/object:Gem::Dependency
68
62
  name: rake
69
63
  requirement: !ruby/object:Gem::Requirement
@@ -110,16 +104,16 @@ dependencies:
110
104
  name: shrine-gridfs
111
105
  requirement: !ruby/object:Gem::Requirement
112
106
  requirements:
113
- - - ">="
107
+ - - "~>"
114
108
  - !ruby/object:Gem::Version
115
- version: '0'
109
+ version: '1.0'
116
110
  type: :development
117
111
  prerelease: false
118
112
  version_requirements: !ruby/object:Gem::Requirement
119
113
  requirements:
120
- - - ">="
114
+ - - "~>"
121
115
  - !ruby/object:Gem::Version
122
- version: '0'
116
+ version: '1.0'
123
117
  - !ruby/object:Gem::Dependency
124
118
  name: aws-sdk-s3
125
119
  requirement: !ruby/object:Gem::Requirement