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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff919875bc708cb71a8aa4d23b799de1d78db5bcc9b3ea67681d3a8bde2b52f8
4
- data.tar.gz: 4c68f86a643f7dd52ed167a8e1b447770fdd8bea4c9a462265e42fefca235125
3
+ metadata.gz: 5feef0e82a301e5ec7bface30f82007d82864dbad49f6ffe9f521522dc4cbf42
4
+ data.tar.gz: 2f0e12df815225d400486c6dbe8779ab9eb665afca82f529c0a94fcd7c607ab5
5
5
  SHA512:
6
- metadata.gz: 7646e2ae1e2770a48d322d765ace1b0afcea3d4d0da1c2cceab6d97a70e2c562d6c115532373723152f2bd2a2e028a4c68739d5ef5b3e699d9a502c148c0bdc2
7
- data.tar.gz: c6cebbef6816c9b987a4806a7a1581b213e882d7f8179fb19845f80650622253f27e2a85412ca61743153295ccd09863ac676bbec2a7771555eb750703458a20
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
- def download_content
54
- options = { read_timeout: Paperclip.options[:read_timeout] }.compact
53
+ if RUBY_VERSION < '2.5'
54
+ def download_content
55
+ options = { read_timeout: Paperclip.options[:read_timeout] }.compact
55
56
 
56
- self.open(@target, options)
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)
@@ -1,3 +1,3 @@
1
1
  module Paperclip
2
- VERSION = "6.4.0" unless defined?(Paperclip::VERSION)
2
+ VERSION = "6.4.1" unless defined?(Paperclip::VERSION)
3
3
  end
@@ -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
- allow_any_instance_of(Paperclip::UriAdapter).to receive(:open).and_return(@open_return)
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(@subject).to receive(:open).with(@uri, {}).at_least(1).times
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(@subject).to receive(:open).with(@uri, read_timeout: 120).at_least(1).times
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.0
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: 2020-12-13 00:00:00.000000000 Z
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: {}