kt-paperclip 6.4.0 → 6.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paperclip/io_adapters/uri_adapter.rb +13 -3
- data/lib/paperclip/version.rb +1 -1
- data/paperclip.gemspec +1 -1
- data/spec/paperclip/io_adapters/uri_adapter_spec.rb +13 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5feef0e82a301e5ec7bface30f82007d82864dbad49f6ffe9f521522dc4cbf42
|
4
|
+
data.tar.gz: 2f0e12df815225d400486c6dbe8779ab9eb665afca82f529c0a94fcd7c607ab5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ded6bae6f8422c9f51aa9ec0d0b098af61f0a502468550afcbfece6e9516e1e4ce4d8b7989f472c92802cdbb17fa5dd33d98c5372161728b22c6ab57801304d
|
7
|
+
data.tar.gz: d3562d3f7e7e5fd35535972157e5d668ad9f2294db4d906e2307227c5c648c63dff231d28809df6d1a670a69f0c21d1e661fa8c0e475256bd8168f8bacb3b233
|
@@ -50,10 +50,20 @@ module Paperclip
|
|
50
50
|
"index.html"
|
51
51
|
end
|
52
52
|
|
53
|
-
|
54
|
-
|
53
|
+
if RUBY_VERSION < '2.5'
|
54
|
+
def download_content
|
55
|
+
options = { read_timeout: Paperclip.options[:read_timeout] }.compact
|
55
56
|
|
56
|
-
|
57
|
+
# rubocop:disable Security/Open
|
58
|
+
open(@target, options)
|
59
|
+
# rubocop:enable Security/Open
|
60
|
+
end
|
61
|
+
else
|
62
|
+
def download_content
|
63
|
+
options = { read_timeout: Paperclip.options[:read_timeout] }.compact
|
64
|
+
|
65
|
+
URI.open(@target, options)
|
66
|
+
end
|
57
67
|
end
|
58
68
|
|
59
69
|
def copy_to_tempfile(src)
|
data/lib/paperclip/version.rb
CHANGED
data/paperclip.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.author = "Surendra Singhi"
|
9
9
|
s.email = ["ssinghi@kreeti.com"]
|
10
|
-
s.homepage = "https://github.com/kreeti/paperclip"
|
10
|
+
s.homepage = "https://github.com/kreeti/kt-paperclip"
|
11
11
|
s.summary = "File attachments as attributes for ActiveRecord"
|
12
12
|
s.description = "Easy upload management for ActiveRecord"
|
13
13
|
s.license = "MIT"
|
@@ -193,9 +193,18 @@ describe Paperclip::UriAdapter do
|
|
193
193
|
|
194
194
|
describe "#download_content" do
|
195
195
|
before do
|
196
|
-
|
196
|
+
allowed_mock =
|
197
|
+
if RUBY_VERSION < '2.5'
|
198
|
+
allow_any_instance_of(Paperclip::UriAdapter)
|
199
|
+
else
|
200
|
+
allow(URI)
|
201
|
+
end
|
202
|
+
|
203
|
+
allowed_mock.to receive(:open).and_return(@open_return)
|
204
|
+
|
197
205
|
@uri = URI.parse("https://github.com/thoughtbot/paper:clip.jpg")
|
198
206
|
@subject = Paperclip.io_adapters.for(@uri)
|
207
|
+
@uri_opener = RUBY_VERSION < '2.5' ? @subject : URI
|
199
208
|
end
|
200
209
|
|
201
210
|
after do
|
@@ -204,7 +213,7 @@ describe Paperclip::UriAdapter do
|
|
204
213
|
|
205
214
|
context "with default read_timeout" do
|
206
215
|
it "calls open without options" do
|
207
|
-
expect(@
|
216
|
+
expect(@uri_opener).to receive(:open).with(@uri, {}).at_least(1).times
|
208
217
|
end
|
209
218
|
end
|
210
219
|
|
@@ -214,7 +223,8 @@ describe Paperclip::UriAdapter do
|
|
214
223
|
end
|
215
224
|
|
216
225
|
it "calls open with read_timeout option" do
|
217
|
-
expect(@
|
226
|
+
expect(@uri_opener)
|
227
|
+
.to receive(:open).with(@uri, read_timeout: 120).at_least(1).times
|
218
228
|
end
|
219
229
|
end
|
220
230
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kt-paperclip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.4.
|
4
|
+
version: 6.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Surendra Singhi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -547,7 +547,7 @@ files:
|
|
547
547
|
- spec/support/reporting.rb
|
548
548
|
- spec/support/test_data.rb
|
549
549
|
- spec/support/version_helper.rb
|
550
|
-
homepage: https://github.com/kreeti/paperclip
|
550
|
+
homepage: https://github.com/kreeti/kt-paperclip
|
551
551
|
licenses:
|
552
552
|
- MIT
|
553
553
|
metadata: {}
|