kt-paperclip 6.4.2 → 7.0.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: 7cff96583dd89dcd0254140d27f4b8043137acd917c804d7710367d719342119
4
- data.tar.gz: 27c6a63b58e72a52ec6ea87e82267d0a3ddb87815333295618d8d179c5c52d45
3
+ metadata.gz: 88e74021df46ad0074287f891fba5ca682856e9e04ee8d4799dd12d3ee6a16b6
4
+ data.tar.gz: 286dd1db7397931937182a720e399073708eb2288e90fb335ba202cb57209803
5
5
  SHA512:
6
- metadata.gz: c37f46113c6c74e4e862b287174873f58d467adcfaee18766738c87eaa1757deac8363810883b3b0ae604d4cfa8b1223ec7edbe3af9687972c7ba53cc62578ab
7
- data.tar.gz: 8cc931814748df871550746bb8798cc06bc018285659f4ddf07632d24d72fa374f867b840a7aa776da957821755cbe869a130abd77ce75636b71a6f5a9df14ed
6
+ metadata.gz: bdd6685f4c714492582fd1fce2a2db7b26b0b6499134438aee64c4f384398cbd9e568ef7640c6856d83cde06b0616e04e081143b5a7131a3d0607258655ff6dd
7
+ data.tar.gz: 258c88aa96a0fee96f8fe1def58e1e6cbf94e59945fed2b41d6e45b71a483fdbb976ccff6b772a8e36fa973ad0f31e1c8d0026975101569393234d4a8f316057
data/.github/FUNDING.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  # These are supported funding model platforms
2
2
 
3
- github: [ssinghi, shalinibhawsingka-kreeti]
3
+ github: [ssinghi, sbhawsingka]
data/.travis.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.2
5
4
  - 2.3
6
5
  - 2.4
7
6
  - 2.5
@@ -25,18 +24,19 @@ gemfile:
25
24
  - gemfiles/5.1.gemfile
26
25
  - gemfiles/5.2.gemfile
27
26
  - gemfiles/6.0.gemfile
27
+ - gemfiles/6.1.gemfile
28
28
 
29
29
  matrix:
30
30
  fast_finish: true
31
31
  exclude:
32
- - gemfile: gemfiles/5.2.gemfile
33
- rvm: 2.2
34
- - gemfile: gemfiles/6.0.gemfile
35
- rvm: 2.2
36
32
  - gemfile: gemfiles/6.0.gemfile
37
33
  rvm: 2.3
38
34
  - gemfile: gemfiles/6.0.gemfile
39
35
  rvm: 2.4
36
+ - gemfile: gemfiles/6.1.gemfile
37
+ rvm: 2.3
38
+ - gemfile: gemfiles/6.1.gemfile
39
+ rvm: 2.4
40
40
  - gemfile: gemfiles/4.2.gemfile
41
41
  rvm: 2.7
42
42
  - gemfile: gemfiles/5.0.gemfile
data/Appraisals CHANGED
@@ -22,3 +22,9 @@ appraise "6.0" do
22
22
  gem "sqlite3", "~> 1.4", platforms: :ruby
23
23
  gem "rails", "~> 6.0.0"
24
24
  end
25
+
26
+ appraise "6.1" do
27
+ gem "sqlite3", "~> 1.4", platforms: :ruby
28
+ gem "aruba", "~> 1.0", ">= 1.0.4"
29
+ gem "rails", "~> 6.1", ">= 6.1.1"
30
+ end
data/Gemfile CHANGED
@@ -11,7 +11,6 @@ group :development, :test do
11
11
  gem "bootsnap", require: false
12
12
  gem "builder"
13
13
  gem "listen", "~> 3.0.8"
14
- gem "mime-types"
15
14
  gem "rspec"
16
15
  gem "rubocop", require: false
17
16
  gem "rubocop-rails"
data/NEWS CHANGED
@@ -1,3 +1,31 @@
1
+ 7.0.0 (2021-05-28)
2
+ * Replace `mimemagic` gem with `marcel` due to licensing issues. See https://github.com/kreeti/kt-paperclip/pull/54 for details and limitations
3
+
4
+ 6.4.1 (2021-01-30)
5
+ * Improvement: Use URI.open in ruby > 2.5 (PR #45)
6
+
7
+ 6.4.0 (2020-12-14)
8
+ * Improvement: Fix Ruby 2.7 method & syntax deprecation warnings (#38)
9
+
10
+ 6.3.0 (2020-08-10)
11
+ * Feature: Add validation_errors_to option - customize copying of errors (#26)
12
+ * Stability: Dropped support for ruby 2.1
13
+
14
+ 6.2.2 (2020-02-18)
15
+ * Bugfix: Add support for Aliases in S3 credentials YAML (accidentally removed during 6.2.0 upgrade).
16
+
17
+ 6.2.1 (2020-01-30)
18
+
19
+ * Bugfix: Auto-loading of the gem code (necessitated due to change in gem name).
20
+
21
+ 6.2.0 (2020-01-23):
22
+
23
+ * Bugfix: Don't do post-processing on invalid attachments (#16).
24
+ * Improvement: Use AWS::S3 built in download_file method (#9).
25
+ * Stability: Rubocop recommended syntax updates (#10, #11, #13, #14).
26
+ * Stability: Testing - replace mocha and bourne with rspec mocks (#6).
27
+ * Stability: Fix test suite to run with Rails 5 and Rails 6 (#19, #20, #7).
28
+
1
29
  6.1.0 (2018-07-27):
2
30
 
3
31
  * BUGFIX: Don't double-encode URLs (Roderick Monje).
data/README.md CHANGED
@@ -90,7 +90,7 @@ Requirements
90
90
 
91
91
  ### Ruby and Rails
92
92
 
93
- Paperclip now requires Ruby version **>= 2.2** and Rails version **>= 4.2**
93
+ Paperclip now requires Ruby version **>= 2.3** and Rails version **>= 4.2**
94
94
  (only if you're going to use Paperclip with Ruby on Rails).
95
95
 
96
96
  ### Image Processor
@@ -171,7 +171,7 @@ Paperclip is distributed as a gem, which is how it should be used in your app.
171
171
  Include the gem in your Gemfile:
172
172
 
173
173
  ```ruby
174
- gem "kt-paperclip", "~> 6.3"
174
+ gem "kt-paperclip", "~> 6.4", ">= 6.4.1"
175
175
  ```
176
176
 
177
177
  Or, if you want to get the latest, you can get master from the main paperclip repository:
@@ -1070,5 +1070,6 @@ Thank you to all [the contributors](https://github.com/kreeti/kt-paperclip/graph
1070
1070
  License
1071
1071
  -------
1072
1072
 
1073
- Paperclip is Copyright © 2008-2017 thoughtbot, inc. It is free software, and may be
1074
- redistributed under the terms specified in the MIT-LICENSE file.
1073
+ Copyright © 2020-2021 Kreeti Technologies Pvt. Ltd.
1074
+ Copyright © 2008-2017 thoughtbot, inc.
1075
+ It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
@@ -23,7 +23,7 @@ When /^I modify my attachment definition to:$/ do |definition|
23
23
  end
24
24
 
25
25
  When /^I upload the fixture "([^"]*)"$/ do |filename|
26
- run_simple %(bundle exec rails runner "User.create!(:attachment => File.open('#{fixture_path(filename)}'))")
26
+ aruba_run_simple %(bundle exec rails runner "User.create!(:attachment => File.open('#{fixture_path(filename)}'))")
27
27
  end
28
28
 
29
29
  Then /^the attachment "([^"]*)" should have a dimension of (\d+x\d+)$/ do |filename, dimension|
@@ -108,3 +108,13 @@ Then /^I should not have attachment columns for "([^"]*)"$/ do |attachment_name|
108
108
  expect(columns).not_to include(*expect_columns)
109
109
  end
110
110
  end
111
+
112
+ # we have to support different versions of aruba, and this method was renamed for 1.0
113
+ # https://github.com/cucumber/aruba/pull/438
114
+ def aruba_run_simple(*args)
115
+ if respond_to?(:run_simple)
116
+ run_simple(*args)
117
+ elsif respond_to?(:run_command_and_stop)
118
+ run_command_and_stop(*args)
119
+ end
120
+ end
data/gemfiles/4.2.gemfile CHANGED
@@ -11,9 +11,9 @@ group :development, :test do
11
11
  gem "bootsnap", require: false
12
12
  gem "builder"
13
13
  gem "listen", "~> 3.0.8"
14
- gem "mime-types"
15
14
  gem "rspec"
16
15
  gem "rubocop", require: false
16
+ gem "rubocop-rails"
17
17
  gem "sprockets", "3.7.2"
18
18
  end
19
19
 
data/gemfiles/5.0.gemfile CHANGED
@@ -11,9 +11,9 @@ group :development, :test do
11
11
  gem "bootsnap", require: false
12
12
  gem "builder"
13
13
  gem "listen", "~> 3.0.8"
14
- gem "mime-types"
15
14
  gem "rspec"
16
15
  gem "rubocop", require: false
16
+ gem "rubocop-rails"
17
17
  gem "sprockets", "3.7.2"
18
18
  end
19
19
 
data/gemfiles/5.1.gemfile CHANGED
@@ -11,9 +11,9 @@ group :development, :test do
11
11
  gem "bootsnap", require: false
12
12
  gem "builder"
13
13
  gem "listen", "~> 3.0.8"
14
- gem "mime-types"
15
14
  gem "rspec"
16
15
  gem "rubocop", require: false
16
+ gem "rubocop-rails"
17
17
  gem "sprockets", "3.7.2"
18
18
  end
19
19
 
data/gemfiles/5.2.gemfile CHANGED
@@ -11,9 +11,9 @@ group :development, :test do
11
11
  gem "bootsnap", require: false
12
12
  gem "builder"
13
13
  gem "listen", "~> 3.0.8"
14
- gem "mime-types"
15
14
  gem "rspec"
16
15
  gem "rubocop", require: false
16
+ gem "rubocop-rails"
17
17
  gem "sprockets", "3.7.2"
18
18
  end
19
19
 
data/gemfiles/6.0.gemfile CHANGED
@@ -11,9 +11,9 @@ group :development, :test do
11
11
  gem "bootsnap", require: false
12
12
  gem "builder"
13
13
  gem "listen", "~> 3.0.8"
14
- gem "mime-types"
15
14
  gem "rspec"
16
15
  gem "rubocop", require: false
16
+ gem "rubocop-rails"
17
17
  gem "sprockets", "3.7.2"
18
18
  end
19
19
 
@@ -0,0 +1,21 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "pry"
6
+ gem "sqlite3", "~> 1.4", platforms: :ruby
7
+ gem "aruba", "~> 1.0", ">= 1.0.4"
8
+ gem "rails", "~> 6.1", ">= 6.1.1"
9
+
10
+ group :development, :test do
11
+ gem "activerecord-import"
12
+ gem "bootsnap", require: false
13
+ gem "builder"
14
+ gem "listen", "~> 3.0.8"
15
+ gem "rspec"
16
+ gem "rubocop", require: false
17
+ gem "rubocop-rails"
18
+ gem "sprockets", "3.7.2"
19
+ end
20
+
21
+ gemspec path: "../"
@@ -60,15 +60,15 @@ module Paperclip
60
60
  end
61
61
 
62
62
  def type_from_file_contents
63
- type_from_mime_magic || type_from_file_command
63
+ type_from_marcel || type_from_file_command
64
64
  rescue Errno::ENOENT => e
65
65
  Paperclip.log("Error while determining content type: #{e}")
66
66
  SENSIBLE_DEFAULT
67
67
  end
68
68
 
69
- def type_from_mime_magic
70
- @type_from_mime_magic ||= File.open(@filepath) do |file|
71
- MimeMagic.by_magic(file).try(:type)
69
+ def type_from_marcel
70
+ @type_from_marcel ||= File.open(@filepath) do |file|
71
+ Marcel::Magic.by_magic(file).try(:type)
72
72
  end
73
73
  end
74
74
 
@@ -1,3 +1,3 @@
1
1
  module Paperclip
2
- VERSION = "6.4.2" unless defined?(Paperclip::VERSION)
2
+ VERSION = "7.0.0" unless defined?(Paperclip::VERSION)
3
3
  end
data/lib/paperclip.rb CHANGED
@@ -64,8 +64,7 @@ rescue LoadError
64
64
  require "mime/types"
65
65
  end
66
66
 
67
- require "mimemagic"
68
- require "mimemagic/overlay"
67
+ require "marcel"
69
68
  require "logger"
70
69
  require "terrapin"
71
70
 
data/paperclip.gemspec CHANGED
@@ -20,12 +20,12 @@ Gem::Specification.new do |s|
20
20
  s.post_install_message = File.read("UPGRADING") if File.exist?("UPGRADING")
21
21
 
22
22
  s.requirements << "ImageMagick"
23
- s.required_ruby_version = ">= 2.2.0"
23
+ s.required_ruby_version = ">= 2.3.0"
24
24
 
25
25
  s.add_dependency("activemodel", ">= 4.2.0")
26
26
  s.add_dependency("activesupport", ">= 4.2.0")
27
27
  s.add_dependency("mime-types")
28
- s.add_dependency("mimemagic", "~> 0.3.0")
28
+ s.add_dependency("marcel", "~> 1.0.1")
29
29
  s.add_dependency("terrapin", "~> 0.6.0")
30
30
 
31
31
  s.add_development_dependency("activerecord", ">= 4.2.0")
@@ -15,7 +15,7 @@ describe Paperclip::AbstractAdapter do
15
15
  before do
16
16
  allow(subject).to receive(:path).and_return("image.png")
17
17
  allow(Paperclip).to receive(:run).and_return("image/png\n")
18
- allow_any_instance_of(Paperclip::ContentTypeDetector).to receive(:type_from_mime_magic).and_return("image/png")
18
+ allow_any_instance_of(Paperclip::ContentTypeDetector).to receive(:type_from_marcel).and_return("image/png")
19
19
  end
20
20
 
21
21
  it "returns the content type without newline" do
@@ -78,7 +78,7 @@ describe Paperclip::FileAdapter do
78
78
  allow(MIME::Types).to receive(:type_for).and_return([])
79
79
  allow(Paperclip).to receive(:run).and_return("application/vnd.ms-office\n")
80
80
  allow_any_instance_of(Paperclip::ContentTypeDetector).
81
- to receive(:type_from_mime_magic).and_return("application/vnd.ms-office")
81
+ to receive(:type_from_marcel).and_return("application/vnd.ms-office")
82
82
 
83
83
  @subject = Paperclip.io_adapters.for(@file)
84
84
  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.2
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Surendra Singhi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-13 00:00:00.000000000 Z
11
+ date: 2021-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: mimemagic
56
+ name: marcel
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.3.0
61
+ version: 1.0.1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.3.0
68
+ version: 1.0.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: terrapin
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -393,6 +393,7 @@ files:
393
393
  - gemfiles/5.1.gemfile
394
394
  - gemfiles/5.2.gemfile
395
395
  - gemfiles/6.0.gemfile
396
+ - gemfiles/6.1.gemfile
396
397
  - lib/generators/paperclip/USAGE
397
398
  - lib/generators/paperclip/paperclip_generator.rb
398
399
  - lib/generators/paperclip/templates/paperclip_migration.rb.erb
@@ -576,7 +577,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
576
577
  requirements:
577
578
  - - ">="
578
579
  - !ruby/object:Gem::Version
579
- version: 2.2.0
580
+ version: 2.3.0
580
581
  required_rubygems_version: !ruby/object:Gem::Requirement
581
582
  requirements:
582
583
  - - ">="
@@ -584,7 +585,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
584
585
  version: '0'
585
586
  requirements:
586
587
  - ImageMagick
587
- rubygems_version: 3.1.6
588
+ rubygems_version: 3.0.1
588
589
  signing_key:
589
590
  specification_version: 4
590
591
  summary: File attachments as attributes for ActiveRecord