shrine-tus 1.0.0 → 1.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
  SHA1:
3
- metadata.gz: 7a80efdb9caee16a6e25d9d1dde239dc53eccfc4
4
- data.tar.gz: 0b793b3e15b7e2da93e6f6b068c3a1898b1ad653
3
+ metadata.gz: a8266797991d2ac84543c91213797ecd9c31b790
4
+ data.tar.gz: fbe306f81df06e0d54fbf621f059f21282d4d41f
5
5
  SHA512:
6
- metadata.gz: 8ebc50f1e3b67661dfe21010135ed89b427ac0b7fb68123160596c20aedf782d8c297bcd3e8794472e3090b3cbd76ff03230c6436344f72a3e010ee3179a1981
7
- data.tar.gz: 9aff64fc286488e699869ec36faac6dac07698a1e9b0bcd5d5128eea6106f98101bed0c2fd14a5f706dcad8b1e16608c7b86aefac4ee8614f7367a55a75dff08
6
+ metadata.gz: 3c1dbe944ac37e28f3aaa0a84adb1a84b631a168fe6411095b91f42a60aebd8a0ba676d79c95bfafaa780d16a688ba9e23f4bb4c645b3dfba8c232ce7f56c3e8
7
+ data.tar.gz: bc31f08763828baac4218e05ad62692860dec0d9c04ca395eb410133267f9f7d44298a663c07dafc8ffcdab6fc86142ab06f704546aed2621c8377ce44360d92
data/README.md CHANGED
@@ -141,6 +141,11 @@ class VideoUploader < Shrine
141
141
  end
142
142
  ```
143
143
 
144
+ Note that it's **not** recommended to use the `delete_promoted` Shrine plugin
145
+ with this this approach, because depending on the tus storage implementation
146
+ it could cause HEAD requests to the tus server app to return a success for files
147
+ that were deleted by Shrine.
148
+
144
149
  These are the performance advantages for each of the official storages:
145
150
 
146
151
  #### Filesystem
@@ -44,9 +44,10 @@ class Shrine
44
44
 
45
45
  def open_from_tus_storage(uid)
46
46
  response = get_tus_file(uid)
47
+ info = get_tus_info(uid)
47
48
 
48
49
  Down::ChunkedIO.new(
49
- size: response.length,
50
+ size: Integer(info["Upload-Length"]),
50
51
  chunks: response.each,
51
52
  on_close: response.method(:close),
52
53
  )
@@ -56,6 +57,10 @@ class Shrine
56
57
  tus_storage.get_file(uid)
57
58
  end
58
59
 
60
+ def get_tus_info(uid)
61
+ tus_storage.read_info(uid)
62
+ end
63
+
59
64
  def tus_uid(url)
60
65
  url.split("/").last
61
66
  end
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 = "1.0.0"
3
+ gem.version = "1.1.0"
4
4
 
5
5
  gem.required_ruby_version = ">= 2.1"
6
6
 
@@ -14,12 +14,12 @@ Gem::Specification.new do |gem|
14
14
  gem.require_path = "lib"
15
15
 
16
16
  gem.add_dependency "shrine", "~> 2.0"
17
- gem.add_dependency "tus-server", "~> 1.0"
17
+ gem.add_dependency "tus-server", "~> 2.0"
18
18
  gem.add_dependency "shrine-url", "~> 1.0"
19
19
 
20
20
  gem.add_development_dependency "rake"
21
21
  gem.add_development_dependency "minitest"
22
22
  gem.add_development_dependency "shrine-gridfs"
23
- gem.add_development_dependency "aws-sdk", "~> 2.1"
23
+ gem.add_development_dependency "aws-sdk-s3", "~> 1.2"
24
24
  gem.add_development_dependency "webmock"
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: 1.0.0
4
+ version: 1.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: 2017-07-17 00:00:00.000000000 Z
11
+ date: 2017-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shrine
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.0'
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.0'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: shrine-url
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -95,19 +95,19 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: aws-sdk
98
+ name: aws-sdk-s3
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '2.1'
103
+ version: '1.2'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '2.1'
110
+ version: '1.2'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: webmock
113
113
  requirement: !ruby/object:Gem::Requirement