shrine-tus 1.1.0 → 1.2.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
- SHA1:
3
- metadata.gz: a8266797991d2ac84543c91213797ecd9c31b790
4
- data.tar.gz: fbe306f81df06e0d54fbf621f059f21282d4d41f
2
+ SHA256:
3
+ metadata.gz: c86f9dc623d2143af39f2d2ae4bb955442caa39acfc0557b48e866345b673c91
4
+ data.tar.gz: a3c1549e07d6282679d56e8ddae7e770aed14994d1d2e84ce80322046b34cb95
5
5
  SHA512:
6
- metadata.gz: 3c1dbe944ac37e28f3aaa0a84adb1a84b631a168fe6411095b91f42a60aebd8a0ba676d79c95bfafaa780d16a688ba9e23f4bb4c645b3dfba8c232ce7f56c3e8
7
- data.tar.gz: bc31f08763828baac4218e05ad62692860dec0d9c04ca395eb410133267f9f7d44298a663c07dafc8ffcdab6fc86142ab06f704546aed2621c8377ce44360d92
6
+ metadata.gz: b02d26741bf7c938602603afbf74974fdc6349dbca89fb478579e40f1d0f74b0516df64933bfff4d4a63ec6aeb0e27476d8b22474ba516298e6a8aeb85b7b1ca
7
+ data.tar.gz: 58d1245d3c22b8c4375559fae4b1fa5abe8de316f9e5d3b9188c183cfcacd16041b99465e439db4e011c46ac5086d2550be430524b630f10c4d1f7716c6015cc
data/README.md CHANGED
@@ -4,8 +4,8 @@ Provides tools for integrating [Shrine] with [tus-ruby-server].
4
4
 
5
5
  ## Installation
6
6
 
7
- ```ruby
8
- gem "shrine-tus"
7
+ ```rb
8
+ gem "shrine-tus", "~> 1.2"
9
9
  ```
10
10
 
11
11
  ## Usage
@@ -54,7 +54,7 @@ require "shrine/storage/tus"
54
54
  Shrine.storages = {
55
55
  cache: Shrine::Storage::YourTemporaryStorage.new(...),
56
56
  store: Shrine::Storage::YourPermanentStorage.new(...),
57
- tus: Shrine::Storage::Tus.new,
57
+ tus: Shrine::Storage::Tus.new
58
58
  }
59
59
  ```
60
60
  ```rb
@@ -63,11 +63,13 @@ class VideoUploader < Shrine
63
63
  end
64
64
  ```
65
65
 
66
- The `Shrine::Storage::Tus` class is a subclass of `Shrine::Storage::Url`, which
67
- uses [Down] for downloading. By default Down uses Ruby's built-in Net::HTTP as
68
- the backend for making download requests, however, for large files it might be
69
- more robust to use `wget` for downloading, as `wget` is able to automatically
70
- resume the download in case of temporary network failures.
66
+ `Shrine::Storage::Tus` is a subclass of `Shrine::Storage::Url`, which uses
67
+ [Down] for downloading. By default, the `Down::Http` backend is used, which is
68
+ implemented using [HTTP.rb].
69
+
70
+ If you're experiencing a lot of network hiccups while downloading, you might
71
+ want to consider switching to the `Down::Wget` backend, as `wget` automatically
72
+ resumes the download in case of network hiccups.
71
73
 
72
74
  ```rb
73
75
  Shrine::Storage::Tus.new(downloader: :wget)
@@ -181,8 +183,9 @@ $ bundle exec rake test
181
183
 
182
184
  [MIT](/LICENSE.txt)
183
185
 
184
- [Shrine]: https://github.com/janko-m/shrine
186
+ [Shrine]: https://github.com/shrinerb/shrine
185
187
  [tus-ruby-server]: https://github.com/janko-m/tus-ruby-server
186
188
  [Down]: https://github.com/janko-m/down
187
- [shrine-tus-demo]: https://github.com/janko-m/shrine-tus-demo
189
+ [HTTP.rb]: https://github.com/httprb/http
190
+ [shrine-tus-demo]: https://github.com/shrinerb/shrine-tus-demo
188
191
  [tusd]: https://github.com/tus/tusd
@@ -7,10 +7,10 @@ class Shrine
7
7
  class Tus < Url
8
8
  attr_reader :tus_storage
9
9
 
10
- def initialize(downloader: :net_http, tus_storage: nil)
10
+ def initialize(tus_storage: nil, **options)
11
11
  @tus_storage = tus_storage
12
12
 
13
- super(downloader: downloader)
13
+ super(**options)
14
14
  end
15
15
 
16
16
  def download(id)
@@ -66,10 +66,8 @@ class Shrine
66
66
  end
67
67
 
68
68
  # Add "Tus-Resumable" header to HEAD and DELETE requests.
69
- def request(*args)
70
- super do |req|
71
- req["Tus-Resumable"] = "1.0.0"
72
- end
69
+ def request(verb, url, **options)
70
+ super(verb, url, headers: { "Tus-Resumable" => "1.0.0" }, **options)
73
71
  end
74
72
  end
75
73
  end
@@ -1,11 +1,11 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "shrine-tus"
3
- gem.version = "1.1.0"
3
+ gem.version = "1.2.0"
4
4
 
5
5
  gem.required_ruby_version = ">= 2.1"
6
6
 
7
7
  gem.summary = "Provides storage and plugin for easier integration between Shrine and tus-ruby-server."
8
- gem.homepage = "https://github.com/janko-m/shrine-tus"
8
+ gem.homepage = "https://github.com/shrinerb/shrine-tus"
9
9
  gem.authors = ["Janko Marohnić"]
10
10
  gem.email = ["janko.marohnic@gmail.com"]
11
11
  gem.license = "MIT"
@@ -15,11 +15,11 @@ Gem::Specification.new do |gem|
15
15
 
16
16
  gem.add_dependency "shrine", "~> 2.0"
17
17
  gem.add_dependency "tus-server", "~> 2.0"
18
- gem.add_dependency "shrine-url", "~> 1.0"
18
+ gem.add_dependency "shrine-url", "~> 2.0"
19
19
 
20
20
  gem.add_development_dependency "rake"
21
21
  gem.add_development_dependency "minitest"
22
+ gem.add_development_dependency "webmock"
22
23
  gem.add_development_dependency "shrine-gridfs"
23
24
  gem.add_development_dependency "aws-sdk-s3", "~> 1.2"
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.1.0
4
+ version: 1.2.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-12-24 00:00:00.000000000 Z
11
+ date: 2018-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shrine
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.0'
47
+ version: '2.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.0'
54
+ version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: shrine-gridfs
84
+ name: webmock
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,33 +95,33 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: aws-sdk-s3
98
+ name: shrine-gridfs
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '1.2'
103
+ version: '0'
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: '1.2'
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: webmock
112
+ name: aws-sdk-s3
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: '1.2'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: '1.2'
125
125
  description:
126
126
  email:
127
127
  - janko.marohnic@gmail.com
@@ -134,7 +134,7 @@ files:
134
134
  - lib/shrine/plugins/tus.rb
135
135
  - lib/shrine/storage/tus.rb
136
136
  - shrine-tus.gemspec
137
- homepage: https://github.com/janko-m/shrine-tus
137
+ homepage: https://github.com/shrinerb/shrine-tus
138
138
  licenses:
139
139
  - MIT
140
140
  metadata: {}
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project:
157
- rubygems_version: 2.6.11
157
+ rubygems_version: 2.7.6
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: Provides storage and plugin for easier integration between Shrine and tus-ruby-server.