kt-paperclip 7.1.1 → 7.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS +9 -1
- data/README.md +3 -3
- data/lib/paperclip/geometry_detector_factory.rb +1 -1
- data/lib/paperclip/glue.rb +3 -2
- data/lib/paperclip/interpolations.rb +6 -2
- data/lib/paperclip/locales/gd.yml +20 -0
- data/lib/paperclip/media_type_spoof_detector.rb +4 -1
- data/lib/paperclip/schema.rb +2 -2
- data/lib/paperclip/storage/s3.rb +17 -3
- data/lib/paperclip/validators/attachment_size_validator.rb +2 -2
- data/lib/paperclip/version.rb +1 -1
- data/paperclip.gemspec +1 -1
- data/spec/paperclip/attachment_spec.rb +6 -6
- data/spec/paperclip/geometry_detector_spec.rb +9 -0
- data/spec/paperclip/geometry_spec.rb +16 -4
- data/spec/paperclip/glue_spec.rb +21 -0
- data/spec/paperclip/io_adapters/uri_adapter_spec.rb +1 -1
- data/spec/paperclip/media_type_spoof_detector_spec.rb +10 -4
- data/spec/paperclip/paperclip_missing_attachment_styles_spec.rb +1 -1
- data/spec/paperclip/paperclip_spec.rb +1 -1
- data/spec/paperclip/schema_spec.rb +18 -18
- data/spec/paperclip/storage/s3_spec.rb +166 -47
- data/spec/spec_helper.rb +1 -0
- data/spec/support/model_reconstruction.rb +3 -3
- metadata +121 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7308352f1d792e5e861ba828d1eb3994b5956fc51df06a4cbfedfe134ce105d
|
4
|
+
data.tar.gz: be4d4161c411a18edaf2a92b5a48d746d87d01f3d5a6e4fe5fecc20f87ad42a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e202f7d5a1a9466f69118e485c5c747f10942644337940b6141ffb41904118353cab09858fbdabf4e68ba87d9e5199109a1a1525d7eaeea4a1601ba9e384459f
|
7
|
+
data.tar.gz: 20fb1d6bd39a2d21a5b2f627d5ab92aba95ae88d523319de7b06e5e0983c281e76ae218a6bccf64fdc16362652cb1cc1251eab7fdacc14b6428b8dbafd2bdc81
|
data/NEWS
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
[UNRELEASED]
|
2
|
-
|
2
|
+
|
3
|
+
7.2.1 (2023-09-09)
|
4
|
+
* Improvement: Support file extension names both as symbols and strings for :content_type_mappings
|
5
|
+
|
6
|
+
7.2.0 (2023-05-30)
|
7
|
+
* Paperclip schema statements are consistent with ActiveRecord::Migration::Compatibility versioning. Old migrations containing Paperclip schema statements perform the same schema changes both before and after an ActiveRecord version upgrade.
|
8
|
+
|
9
|
+
7.0.1 (2021-10-06)
|
10
|
+
* Issue file delete only once per unique style when nullifying attachment or destroying an object. Avoids triggering a rate limit error on Google Cloud Storage.
|
3
11
|
|
4
12
|
7.0.0 (2021-05-28)
|
5
13
|
* Replace `mimemagic` gem with `marcel` due to licensing issues. See https://github.com/kreeti/kt-paperclip/pull/54 for details and limitations
|
data/README.md
CHANGED
@@ -592,9 +592,9 @@ Storage
|
|
592
592
|
|
593
593
|
Paperclip ships with 3 storage adapters:
|
594
594
|
|
595
|
-
* File Storage
|
596
|
-
* S3 Storage (via `aws-sdk-s3`)
|
597
|
-
* Fog Storage
|
595
|
+
* File Storage (`storage: :filesystem`)
|
596
|
+
* S3 Storage (via `aws-sdk-s3`) (`storage: :s3`)
|
597
|
+
* Fog Storage (`storage: :fog`)
|
598
598
|
|
599
599
|
If you would like to use Paperclip with another storage, you can install these
|
600
600
|
gems along side with Paperclip:
|
@@ -7,7 +7,7 @@ module Paperclip
|
|
7
7
|
|
8
8
|
def make
|
9
9
|
geometry = GeometryParser.new(geometry_string.strip).make
|
10
|
-
geometry || raise(Errors::NotIdentifiedByImageMagickError.new)
|
10
|
+
geometry || raise(Errors::NotIdentifiedByImageMagickError.new("Could not identify image size"))
|
11
11
|
end
|
12
12
|
|
13
13
|
private
|
data/lib/paperclip/glue.rb
CHANGED
@@ -4,14 +4,15 @@ require "paperclip/schema"
|
|
4
4
|
|
5
5
|
module Paperclip
|
6
6
|
module Glue
|
7
|
+
LOCALE_PATHS = Dir.glob("#{File.dirname(__FILE__)}/locales/*.{rb,yml}")
|
8
|
+
|
7
9
|
def self.included(base)
|
8
10
|
base.extend ClassMethods
|
9
11
|
base.send :include, Callbacks
|
10
12
|
base.send :include, Validators
|
11
13
|
base.send :include, Schema if defined? ActiveRecord::Base
|
12
14
|
|
13
|
-
|
14
|
-
I18n.load_path += locale_path unless I18n.load_path.include?(locale_path)
|
15
|
+
I18n.load_path += LOCALE_PATHS unless (LOCALE_PATHS - I18n.load_path).empty?
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -54,10 +54,14 @@ module Paperclip
|
|
54
54
|
# Returns the interpolated URL. Will raise an error if the url itself
|
55
55
|
# contains ":url" to prevent infinite recursion. This interpolation
|
56
56
|
# is used in the default :path to ease default specifications.
|
57
|
-
RIGHT_HERE = "#{__FILE__.gsub(%r{\A\./}, '')}:#{__LINE__ + 3}"
|
58
57
|
def url(attachment, style_name)
|
59
|
-
|
58
|
+
if Thread.current.thread_variable_get(:kt_paperclip_no_recursion)
|
59
|
+
raise Errors::InfiniteInterpolationError
|
60
|
+
end
|
61
|
+
Thread.current.thread_variable_set(:kt_paperclip_no_recursion, true)
|
60
62
|
attachment.url(style_name, timestamp: false, escape: false)
|
63
|
+
ensure
|
64
|
+
Thread.current.thread_variable_set(:kt_paperclip_no_recursion, false)
|
61
65
|
end
|
62
66
|
|
63
67
|
# Returns the timestamp as defined by the <attachment>_updated_at field
|
@@ -0,0 +1,20 @@
|
|
1
|
+
gd:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
in_between: "– feumaidh seo a bhith eadar %{min} ’s %{max}"
|
5
|
+
spoofed_media_type: "– tha susbaint ann nach eil a-rèir na chaidh aithris"
|
6
|
+
|
7
|
+
number:
|
8
|
+
human:
|
9
|
+
storage_units:
|
10
|
+
format: "%n %u"
|
11
|
+
units:
|
12
|
+
byte:
|
13
|
+
one: "bhaidht"
|
14
|
+
two: "bhaidht"
|
15
|
+
few: "baidhtean"
|
16
|
+
other: "baidht"
|
17
|
+
kb: "KB"
|
18
|
+
mb: "MB"
|
19
|
+
gb: "GB"
|
20
|
+
tb: "TB"
|
@@ -76,11 +76,14 @@ module Paperclip
|
|
76
76
|
Paperclip.run("file", "-b --mime :file", file: @file.path).
|
77
77
|
split(/[:;\s]+/).first
|
78
78
|
rescue Terrapin::CommandLineError
|
79
|
+
Paperclip.log("Problem getting type from `file` command. Possible that `file` doesn't exist on this system. Content Type validations don't work without this.")
|
80
|
+
|
79
81
|
""
|
80
82
|
end
|
81
83
|
|
82
84
|
def mapped_content_type
|
83
|
-
Paperclip.options[:content_type_mappings]
|
85
|
+
content_type_mappings = Paperclip.options[:content_type_mappings]
|
86
|
+
content_type_mappings[filename_extension] || content_type_mappings[filename_extension.to_s]
|
84
87
|
end
|
85
88
|
|
86
89
|
def filename_extension
|
data/lib/paperclip/schema.rb
CHANGED
@@ -6,12 +6,12 @@ module Paperclip
|
|
6
6
|
COLUMNS = { file_name: :string,
|
7
7
|
content_type: :string,
|
8
8
|
file_size: :bigint,
|
9
|
-
updated_at: :datetime }
|
9
|
+
updated_at: :datetime }
|
10
10
|
|
11
11
|
def self.included(_base)
|
12
12
|
ActiveRecord::ConnectionAdapters::Table.include TableDefinition
|
13
13
|
ActiveRecord::ConnectionAdapters::TableDefinition.include TableDefinition
|
14
|
-
ActiveRecord::
|
14
|
+
ActiveRecord::Migration.include Statements
|
15
15
|
ActiveRecord::Migration::CommandRecorder.include CommandRecorder
|
16
16
|
end
|
17
17
|
|
data/lib/paperclip/storage/s3.rb
CHANGED
@@ -137,6 +137,9 @@ module Paperclip
|
|
137
137
|
@s3_headers = {}
|
138
138
|
merge_s3_headers(@options[:s3_headers], @s3_headers, @s3_metadata)
|
139
139
|
|
140
|
+
@s3_acl_enabled = @options[:s3_acl_enabled]
|
141
|
+
@s3_acl_enabled = true if @s3_acl_enabled.nil?
|
142
|
+
|
140
143
|
@s3_storage_class = set_storage_class(@options[:s3_storage_class])
|
141
144
|
|
142
145
|
@s3_server_side_encryption = "AES256"
|
@@ -359,9 +362,12 @@ module Paperclip
|
|
359
362
|
log("saving #{path(style)}")
|
360
363
|
write_options = {
|
361
364
|
content_type: file.content_type,
|
362
|
-
acl: s3_permissions(style)
|
363
365
|
}
|
364
366
|
|
367
|
+
if @s3_acl_enabled
|
368
|
+
write_options[:acl] = s3_permissions(style)
|
369
|
+
end
|
370
|
+
|
365
371
|
# add storage class for this style if defined
|
366
372
|
storage_class = s3_storage_class(style)
|
367
373
|
write_options.merge!(storage_class: storage_class) if storage_class
|
@@ -427,9 +433,9 @@ module Paperclip
|
|
427
433
|
def find_credentials(creds)
|
428
434
|
case creds
|
429
435
|
when File
|
430
|
-
|
436
|
+
load_credentials_from_file(creds.path)
|
431
437
|
when String, Pathname
|
432
|
-
|
438
|
+
load_credentials_from_file(creds)
|
433
439
|
when Hash
|
434
440
|
creds
|
435
441
|
when NilClass
|
@@ -439,6 +445,14 @@ module Paperclip
|
|
439
445
|
end
|
440
446
|
end
|
441
447
|
|
448
|
+
def load_credentials_from_file(path)
|
449
|
+
if Gem::Version.new(Psych::VERSION) >= Gem::Version.new("3.1.0")
|
450
|
+
YAML::safe_load(ERB.new(File.read(path)).result, aliases: true)
|
451
|
+
else
|
452
|
+
YAML::safe_load(ERB.new(File.read(path)).result, [], [], true)
|
453
|
+
end
|
454
|
+
end
|
455
|
+
|
442
456
|
def use_secure_protocol?(style_name)
|
443
457
|
s3_protocol(style_name) == "https"
|
444
458
|
end
|
@@ -35,8 +35,8 @@ module Paperclip
|
|
35
35
|
options.slice(*AVAILABLE_CHECKS).each do |option, option_value|
|
36
36
|
option_value = option_value.call(record) if option_value.is_a?(Proc)
|
37
37
|
option_value = extract_option_value(option, option_value)
|
38
|
-
operator =
|
39
|
-
|
38
|
+
operator = ActiveModel::VERSION::MAJOR >= 7 ? COMPARE_CHECKS[option] : CHECKS[option]
|
39
|
+
|
40
40
|
unless value.send(operator, option_value)
|
41
41
|
error_message_key = options[:in] ? :in_between : option
|
42
42
|
error_attrs.each do |error_attr_name|
|
data/lib/paperclip/version.rb
CHANGED
data/paperclip.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.add_dependency("activesupport", ">= 4.2.0")
|
27
27
|
s.add_dependency("mime-types")
|
28
28
|
s.add_dependency("marcel", "~> 1.0.1")
|
29
|
-
s.add_dependency("terrapin", "
|
29
|
+
s.add_dependency("terrapin", ">= 0.6.0", "< 2.0")
|
30
30
|
|
31
31
|
s.add_development_dependency("activerecord", ">= 4.2.0")
|
32
32
|
s.add_development_dependency("appraisal")
|
@@ -1333,7 +1333,7 @@ describe Paperclip::Attachment do
|
|
1333
1333
|
|
1334
1334
|
context "An attachment with only a avatar_file_name column" do
|
1335
1335
|
before do
|
1336
|
-
ActiveRecord::
|
1336
|
+
ActiveRecord::Migration.create_table :dummies, force: true do |table|
|
1337
1337
|
table.column :avatar_file_name, :string
|
1338
1338
|
end
|
1339
1339
|
rebuild_class
|
@@ -1359,7 +1359,7 @@ describe Paperclip::Attachment do
|
|
1359
1359
|
|
1360
1360
|
context "and avatar_created_at column" do
|
1361
1361
|
before do
|
1362
|
-
ActiveRecord::
|
1362
|
+
ActiveRecord::Migration.add_column :dummies, :avatar_created_at, :timestamp
|
1363
1363
|
rebuild_class
|
1364
1364
|
@dummy = Dummy.new
|
1365
1365
|
end
|
@@ -1396,7 +1396,7 @@ describe Paperclip::Attachment do
|
|
1396
1396
|
|
1397
1397
|
context "and avatar_updated_at column" do
|
1398
1398
|
before do
|
1399
|
-
ActiveRecord::
|
1399
|
+
ActiveRecord::Migration.add_column :dummies, :avatar_updated_at, :timestamp
|
1400
1400
|
rebuild_class
|
1401
1401
|
@dummy = Dummy.new
|
1402
1402
|
end
|
@@ -1426,7 +1426,7 @@ describe Paperclip::Attachment do
|
|
1426
1426
|
|
1427
1427
|
context "and avatar_content_type column" do
|
1428
1428
|
before do
|
1429
|
-
ActiveRecord::
|
1429
|
+
ActiveRecord::Migration.add_column :dummies, :avatar_content_type, :string
|
1430
1430
|
rebuild_class
|
1431
1431
|
@dummy = Dummy.new
|
1432
1432
|
end
|
@@ -1443,7 +1443,7 @@ describe Paperclip::Attachment do
|
|
1443
1443
|
|
1444
1444
|
context "and avatar_file_size column" do
|
1445
1445
|
before do
|
1446
|
-
ActiveRecord::
|
1446
|
+
ActiveRecord::Migration.add_column :dummies, :avatar_file_size, :bigint
|
1447
1447
|
rebuild_class
|
1448
1448
|
@dummy = Dummy.new
|
1449
1449
|
end
|
@@ -1467,7 +1467,7 @@ describe Paperclip::Attachment do
|
|
1467
1467
|
|
1468
1468
|
context "and avatar_fingerprint column" do
|
1469
1469
|
before do
|
1470
|
-
ActiveRecord::
|
1470
|
+
ActiveRecord::Migration.add_column :dummies, :avatar_fingerprint, :string
|
1471
1471
|
rebuild_class
|
1472
1472
|
@dummy = Dummy.new
|
1473
1473
|
end
|
@@ -35,4 +35,13 @@ describe Paperclip::GeometryDetector do
|
|
35
35
|
Paperclip.options[:use_exif_orientation] = true
|
36
36
|
end
|
37
37
|
end
|
38
|
+
|
39
|
+
it "raises an exception with a message when the file is not an image" do
|
40
|
+
file = fixture_file("text.txt")
|
41
|
+
factory = Paperclip::GeometryDetector.new(file)
|
42
|
+
|
43
|
+
expect do
|
44
|
+
factory.make
|
45
|
+
end.to raise_error(Paperclip::Errors::NotIdentifiedByImageMagickError, "Could not identify image size")
|
46
|
+
end
|
38
47
|
end
|
@@ -147,23 +147,35 @@ describe Paperclip::Geometry do
|
|
147
147
|
|
148
148
|
it "does not generate from a bad file" do
|
149
149
|
file = "/home/This File Does Not Exist.omg"
|
150
|
-
expect
|
150
|
+
expect do
|
151
|
+
@geo = Paperclip::Geometry.from_file(file)
|
152
|
+
end.to raise_error(Paperclip::Errors::NotIdentifiedByImageMagickError,
|
153
|
+
"Could not identify image size")
|
151
154
|
end
|
152
155
|
|
153
156
|
it "does not generate from a blank filename" do
|
154
157
|
file = ""
|
155
|
-
expect
|
158
|
+
expect do
|
159
|
+
@geo = Paperclip::Geometry.from_file(file)
|
160
|
+
end.to raise_error(Paperclip::Errors::NotIdentifiedByImageMagickError,
|
161
|
+
"Cannot find the geometry of a file with a blank name")
|
156
162
|
end
|
157
163
|
|
158
164
|
it "does not generate from a nil file" do
|
159
165
|
file = nil
|
160
|
-
expect
|
166
|
+
expect do
|
167
|
+
@geo = Paperclip::Geometry.from_file(file)
|
168
|
+
end.to raise_error(Paperclip::Errors::NotIdentifiedByImageMagickError,
|
169
|
+
"Cannot find the geometry of a file with a blank name")
|
161
170
|
end
|
162
171
|
|
163
172
|
it "does not generate from a file with no path" do
|
164
173
|
file = double("file", path: "")
|
165
174
|
allow(file).to receive(:respond_to?).with(:path).and_return(true)
|
166
|
-
expect
|
175
|
+
expect do
|
176
|
+
@geo = Paperclip::Geometry.from_file(file)
|
177
|
+
end.to raise_error(Paperclip::Errors::NotIdentifiedByImageMagickError,
|
178
|
+
"Cannot find the geometry of a file with a blank name")
|
167
179
|
end
|
168
180
|
|
169
181
|
it "lets us know when a command isn't found versus a processing error" do
|
data/spec/paperclip/glue_spec.rb
CHANGED
@@ -39,4 +39,25 @@ describe Paperclip::Glue do
|
|
39
39
|
Object.send :remove_const, "NonActiveRecordModel"
|
40
40
|
end
|
41
41
|
end
|
42
|
+
|
43
|
+
describe "when included" do
|
44
|
+
it "does not mutate I18n.load_path more than once" do
|
45
|
+
before_load_path = I18n.load_path
|
46
|
+
I18n.load_path = []
|
47
|
+
|
48
|
+
# expect twice because the load_path is reset after creating the classes
|
49
|
+
expect(I18n.config).to receive(:load_path=).and_call_original.twice
|
50
|
+
|
51
|
+
FirstModel = Class.new
|
52
|
+
FirstModel.include Paperclip::Glue
|
53
|
+
|
54
|
+
SecondModel = Class.new
|
55
|
+
SecondModel.include Paperclip::Glue
|
56
|
+
|
57
|
+
ThirdModel = Class.new
|
58
|
+
ThirdModel.include Paperclip::Glue
|
59
|
+
|
60
|
+
I18n.load_path = before_load_path
|
61
|
+
end
|
62
|
+
end
|
42
63
|
end
|
@@ -224,7 +224,7 @@ describe Paperclip::UriAdapter do
|
|
224
224
|
|
225
225
|
it "calls open with read_timeout option" do
|
226
226
|
expect(@uri_opener)
|
227
|
-
.to receive(:open).with(@uri, read_timeout: 120).at_least(1).times
|
227
|
+
.to receive(:open).with(@uri, { read_timeout: 120 }).at_least(1).times
|
228
228
|
end
|
229
229
|
end
|
230
230
|
end
|
@@ -32,12 +32,18 @@ describe Paperclip::MediaTypeSpoofDetector do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
it "does not reject when the extension => content_type is in :content_type_mappings" do
|
35
|
+
file = Tempfile.open(["test", ".PEM"])
|
36
|
+
file.puts "Certificate!"
|
37
|
+
file.close
|
38
|
+
|
39
|
+
adapter = Paperclip.io_adapters.for(File.new(file.path))
|
40
|
+
|
35
41
|
begin
|
36
42
|
Paperclip.options[:content_type_mappings] = { pem: "text/plain" }
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
43
|
+
assert !Paperclip::MediaTypeSpoofDetector.using(adapter, adapter.original_filename, adapter.content_type).spoofed?
|
44
|
+
|
45
|
+
# As a string.
|
46
|
+
Paperclip.options[:content_type_mappings] = { "pem" => "text/plain" }
|
41
47
|
assert !Paperclip::MediaTypeSpoofDetector.using(adapter, adapter.original_filename, adapter.content_type).spoofed?
|
42
48
|
ensure
|
43
49
|
Paperclip.options[:content_type_mappings] = {}
|
@@ -49,7 +49,7 @@ describe "Missing Attachment Styles" do
|
|
49
49
|
expected_hash = { Dummy: { avatar: [:export, :thumb] } }
|
50
50
|
assert_equal expected_hash, Paperclip.missing_attachments_styles
|
51
51
|
|
52
|
-
ActiveRecord::
|
52
|
+
ActiveRecord::Migration.create_table :books, force: true
|
53
53
|
class ::Book < ActiveRecord::Base
|
54
54
|
has_attached_file :cover, styles: { small: "x100", large: "1000x1000>" }
|
55
55
|
has_attached_file :sample, styles: { thumb: "x100" }
|
@@ -63,7 +63,7 @@ describe Paperclip do
|
|
63
63
|
context "Calling Paperclip.run with a logger" do
|
64
64
|
it "passes the defined logger if :log_command is set" do
|
65
65
|
Paperclip.options[:log_command] = true
|
66
|
-
expect(Terrapin::CommandLine).to receive(:new).with("convert", "stuff", logger: Paperclip.logger).and_return(double(run: nil))
|
66
|
+
expect(Terrapin::CommandLine).to receive(:new).with("convert", "stuff", { logger: Paperclip.logger }).and_return(double(run: nil))
|
67
67
|
Paperclip.run("convert", "stuff")
|
68
68
|
end
|
69
69
|
end
|
@@ -11,7 +11,7 @@ describe Paperclip::Schema do
|
|
11
11
|
|
12
12
|
after do
|
13
13
|
begin
|
14
|
-
|
14
|
+
ActiveRecord::Migration.drop_table :dummies
|
15
15
|
rescue StandardError
|
16
16
|
nil
|
17
17
|
end
|
@@ -23,7 +23,7 @@ describe Paperclip::Schema do
|
|
23
23
|
ActiveSupport::Deprecation.silenced = false
|
24
24
|
end
|
25
25
|
it "creates attachment columns" do
|
26
|
-
|
26
|
+
ActiveRecord::Migration.create_table :dummies, force: true do |t|
|
27
27
|
ActiveSupport::Deprecation.silence do
|
28
28
|
t.has_attached_file :avatar
|
29
29
|
end
|
@@ -38,7 +38,7 @@ describe Paperclip::Schema do
|
|
38
38
|
end
|
39
39
|
|
40
40
|
it "displays deprecation warning" do
|
41
|
-
|
41
|
+
ActiveRecord::Migration.create_table :dummies, force: true do |t|
|
42
42
|
assert_deprecated do
|
43
43
|
t.has_attached_file :avatar
|
44
44
|
end
|
@@ -48,7 +48,7 @@ describe Paperclip::Schema do
|
|
48
48
|
|
49
49
|
context "using #attachment" do
|
50
50
|
before do
|
51
|
-
|
51
|
+
ActiveRecord::Migration.create_table :dummies, force: true do |t|
|
52
52
|
t.attachment :avatar
|
53
53
|
end
|
54
54
|
end
|
@@ -65,7 +65,7 @@ describe Paperclip::Schema do
|
|
65
65
|
|
66
66
|
context "using #attachment with options" do
|
67
67
|
before do
|
68
|
-
|
68
|
+
ActiveRecord::Migration.create_table :dummies, force: true do |t|
|
69
69
|
t.attachment :avatar, default: 1, file_name: { default: "default" }
|
70
70
|
end
|
71
71
|
end
|
@@ -83,13 +83,13 @@ describe Paperclip::Schema do
|
|
83
83
|
|
84
84
|
context "within schema statement" do
|
85
85
|
before do
|
86
|
-
|
86
|
+
ActiveRecord::Migration.create_table :dummies, force: true
|
87
87
|
end
|
88
88
|
|
89
89
|
context "migrating up" do
|
90
90
|
context "with single attachment" do
|
91
91
|
before do
|
92
|
-
|
92
|
+
ActiveRecord::Migration.add_attachment :dummies, :avatar
|
93
93
|
end
|
94
94
|
|
95
95
|
it "creates attachment columns" do
|
@@ -104,7 +104,7 @@ describe Paperclip::Schema do
|
|
104
104
|
|
105
105
|
context "with single attachment and options" do
|
106
106
|
before do
|
107
|
-
|
107
|
+
ActiveRecord::Migration.add_attachment :dummies, :avatar, default: "1", file_name: { default: "default" }
|
108
108
|
end
|
109
109
|
|
110
110
|
it "sets defaults on columns" do
|
@@ -119,7 +119,7 @@ describe Paperclip::Schema do
|
|
119
119
|
|
120
120
|
context "with multiple attachments" do
|
121
121
|
before do
|
122
|
-
|
122
|
+
ActiveRecord::Migration.add_attachment :dummies, :avatar, :photo
|
123
123
|
end
|
124
124
|
|
125
125
|
it "creates attachment columns" do
|
@@ -138,7 +138,7 @@ describe Paperclip::Schema do
|
|
138
138
|
|
139
139
|
context "with multiple attachments and options" do
|
140
140
|
before do
|
141
|
-
|
141
|
+
ActiveRecord::Migration.add_attachment :dummies, :avatar, :photo, default: "1", file_name: { default: "default" }
|
142
142
|
end
|
143
143
|
|
144
144
|
it "sets defaults on columns" do
|
@@ -157,7 +157,7 @@ describe Paperclip::Schema do
|
|
157
157
|
context "with no attachment" do
|
158
158
|
it "raises an error" do
|
159
159
|
assert_raises ArgumentError do
|
160
|
-
|
160
|
+
ActiveRecord::Migration.add_attachment :dummies
|
161
161
|
end
|
162
162
|
end
|
163
163
|
end
|
@@ -165,7 +165,7 @@ describe Paperclip::Schema do
|
|
165
165
|
|
166
166
|
context "migrating down" do
|
167
167
|
before do
|
168
|
-
|
168
|
+
ActiveRecord::Migration.change_table :dummies do |t|
|
169
169
|
t.column :avatar_file_name, :string
|
170
170
|
t.column :avatar_content_type, :string
|
171
171
|
t.column :avatar_file_size, :bigint
|
@@ -179,7 +179,7 @@ describe Paperclip::Schema do
|
|
179
179
|
end
|
180
180
|
it "removes the attachment columns" do
|
181
181
|
ActiveSupport::Deprecation.silence do
|
182
|
-
|
182
|
+
ActiveRecord::Migration.drop_attached_file :dummies, :avatar
|
183
183
|
end
|
184
184
|
|
185
185
|
columns = Dummy.columns.map { |column| [column.name, column.sql_type] }
|
@@ -192,7 +192,7 @@ describe Paperclip::Schema do
|
|
192
192
|
|
193
193
|
it "displays a deprecation warning" do
|
194
194
|
assert_deprecated do
|
195
|
-
|
195
|
+
ActiveRecord::Migration.drop_attached_file :dummies, :avatar
|
196
196
|
end
|
197
197
|
end
|
198
198
|
end
|
@@ -200,7 +200,7 @@ describe Paperclip::Schema do
|
|
200
200
|
context "using #remove_attachment" do
|
201
201
|
context "with single attachment" do
|
202
202
|
before do
|
203
|
-
|
203
|
+
ActiveRecord::Migration.remove_attachment :dummies, :avatar
|
204
204
|
end
|
205
205
|
|
206
206
|
it "removes the attachment columns" do
|
@@ -215,14 +215,14 @@ describe Paperclip::Schema do
|
|
215
215
|
|
216
216
|
context "with multiple attachments" do
|
217
217
|
before do
|
218
|
-
|
218
|
+
ActiveRecord::Migration.change_table :dummies do |t|
|
219
219
|
t.column :photo_file_name, :string
|
220
220
|
t.column :photo_content_type, :string
|
221
221
|
t.column :photo_file_size, :bigint
|
222
222
|
t.column :photo_updated_at, :datetime
|
223
223
|
end
|
224
224
|
|
225
|
-
|
225
|
+
ActiveRecord::Migration.remove_attachment :dummies, :avatar, :photo
|
226
226
|
end
|
227
227
|
|
228
228
|
it "removes the attachment columns" do
|
@@ -242,7 +242,7 @@ describe Paperclip::Schema do
|
|
242
242
|
context "with no attachment" do
|
243
243
|
it "raises an error" do
|
244
244
|
assert_raises ArgumentError do
|
245
|
-
|
245
|
+
ActiveRecord::Migration.remove_attachment :dummies
|
246
246
|
end
|
247
247
|
end
|
248
248
|
end
|
@@ -395,12 +395,22 @@ describe Paperclip::Storage::S3 do
|
|
395
395
|
allow(@dummy.avatar).to receive(:s3_object).with(:thumbnail).and_return(object)
|
396
396
|
|
397
397
|
expect(object).to receive(:upload_file).
|
398
|
-
with(
|
399
|
-
|
398
|
+
with(
|
399
|
+
anything,
|
400
|
+
{
|
401
|
+
content_type: "image/png",
|
402
|
+
acl: :"public-read",
|
403
|
+
},
|
404
|
+
)
|
400
405
|
expect(object).to receive(:upload_file).
|
401
|
-
with(
|
402
|
-
|
403
|
-
|
406
|
+
with(
|
407
|
+
anything,
|
408
|
+
{
|
409
|
+
content_type: "image/png",
|
410
|
+
acl: :"public-read",
|
411
|
+
cache_control: "max-age=31557600",
|
412
|
+
},
|
413
|
+
)
|
404
414
|
@dummy.save
|
405
415
|
end
|
406
416
|
|
@@ -411,6 +421,62 @@ describe Paperclip::Storage::S3 do
|
|
411
421
|
end
|
412
422
|
end
|
413
423
|
|
424
|
+
context "An attachment that uses S3 for storage with acl disabled" do
|
425
|
+
before do
|
426
|
+
rebuild_model(
|
427
|
+
aws2_add_region.merge(
|
428
|
+
storage: :s3,
|
429
|
+
styles: { thumb: ["90x90#", :jpg] },
|
430
|
+
bucket: "bucket",
|
431
|
+
s3_acl_enabled: false,
|
432
|
+
s3_credentials: {
|
433
|
+
"access_key_id" => "12345",
|
434
|
+
"secret_access_key" => "54321"
|
435
|
+
}
|
436
|
+
)
|
437
|
+
)
|
438
|
+
|
439
|
+
@file = File.new(fixture_file("5k.png"), "rb")
|
440
|
+
@dummy = Dummy.new
|
441
|
+
@dummy.avatar = @file
|
442
|
+
@dummy.save
|
443
|
+
end
|
444
|
+
|
445
|
+
context "reprocess" do
|
446
|
+
before do
|
447
|
+
@object = double
|
448
|
+
allow(@dummy.avatar).to receive(:s3_object).with(:original).and_return(@object)
|
449
|
+
allow(@dummy.avatar).to receive(:s3_object).with(:thumb).and_return(@object)
|
450
|
+
allow(@object).to receive(:get).and_yield(@file.read)
|
451
|
+
allow(@object).to receive(:exists?).and_return(true)
|
452
|
+
allow(@object).to receive(:download_file).with(anything)
|
453
|
+
end
|
454
|
+
|
455
|
+
it "uploads original" do
|
456
|
+
expect(@object).to receive(:upload_file).with(
|
457
|
+
anything,
|
458
|
+
{ content_type: "image/png" },
|
459
|
+
).and_return(true)
|
460
|
+
@dummy.avatar.reprocess!
|
461
|
+
expect(@object).to receive(:upload_file).with(
|
462
|
+
anything,
|
463
|
+
{ content_type: "image/png" },
|
464
|
+
).and_return(true)
|
465
|
+
@dummy.avatar.reprocess!
|
466
|
+
end
|
467
|
+
|
468
|
+
it "doesn't upload original" do
|
469
|
+
expect(@object).to receive(:upload_file).with(
|
470
|
+
anything,
|
471
|
+
{ content_type: "image/png" },
|
472
|
+
).and_return(true)
|
473
|
+
@dummy.avatar.reprocess!
|
474
|
+
end
|
475
|
+
end
|
476
|
+
|
477
|
+
after { @file.close }
|
478
|
+
end
|
479
|
+
|
414
480
|
context "An attachment that uses S3 for storage and has styles" do
|
415
481
|
before do
|
416
482
|
rebuild_model(
|
@@ -444,14 +510,18 @@ describe Paperclip::Storage::S3 do
|
|
444
510
|
it "uploads original" do
|
445
511
|
expect(@object).to receive(:upload_file).with(
|
446
512
|
anything,
|
447
|
-
|
448
|
-
|
513
|
+
{
|
514
|
+
content_type: "image/png",
|
515
|
+
acl: :"public-read",
|
516
|
+
},
|
449
517
|
).and_return(true)
|
450
518
|
@dummy.avatar.reprocess!
|
451
519
|
expect(@object).to receive(:upload_file).with(
|
452
520
|
anything,
|
453
|
-
|
454
|
-
|
521
|
+
{
|
522
|
+
content_type: "image/png",
|
523
|
+
acl: :"public-read",
|
524
|
+
},
|
455
525
|
).and_return(true)
|
456
526
|
@dummy.avatar.reprocess!
|
457
527
|
end
|
@@ -459,8 +529,10 @@ describe Paperclip::Storage::S3 do
|
|
459
529
|
it "doesn't upload original" do
|
460
530
|
expect(@object).to receive(:upload_file).with(
|
461
531
|
anything,
|
462
|
-
|
463
|
-
|
532
|
+
{
|
533
|
+
content_type: "image/png",
|
534
|
+
acl: :"public-read",
|
535
|
+
},
|
464
536
|
).and_return(true)
|
465
537
|
@dummy.avatar.reprocess!
|
466
538
|
end
|
@@ -669,7 +741,7 @@ describe Paperclip::Storage::S3 do
|
|
669
741
|
object = double
|
670
742
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
671
743
|
|
672
|
-
expect(object).to receive(:presigned_url).with(:get, expires_in: 3600)
|
744
|
+
expect(object).to receive(:presigned_url).with(:get, { expires_in: 3600 })
|
673
745
|
@dummy.avatar.expiring_url
|
674
746
|
end
|
675
747
|
end
|
@@ -684,8 +756,13 @@ describe Paperclip::Storage::S3 do
|
|
684
756
|
object = double
|
685
757
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
686
758
|
expect(object).to receive(:presigned_url).
|
687
|
-
with(
|
688
|
-
|
759
|
+
with(
|
760
|
+
:get,
|
761
|
+
{
|
762
|
+
expires_in: 3600,
|
763
|
+
response_content_disposition: "inline",
|
764
|
+
},
|
765
|
+
)
|
689
766
|
@dummy.avatar.expiring_url
|
690
767
|
end
|
691
768
|
end
|
@@ -707,7 +784,13 @@ describe Paperclip::Storage::S3 do
|
|
707
784
|
object = double
|
708
785
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
709
786
|
expect(object).to receive(:presigned_url).
|
710
|
-
with(
|
787
|
+
with(
|
788
|
+
:get,
|
789
|
+
{
|
790
|
+
expires_in: 3600,
|
791
|
+
response_content_type: "image/png",
|
792
|
+
},
|
793
|
+
)
|
711
794
|
@dummy.avatar.expiring_url
|
712
795
|
end
|
713
796
|
end
|
@@ -754,14 +837,14 @@ describe Paperclip::Storage::S3 do
|
|
754
837
|
it "generates a url for the thumb" do
|
755
838
|
object = double
|
756
839
|
allow(@dummy.avatar).to receive(:s3_object).with(:thumb).and_return(object)
|
757
|
-
expect(object).to receive(:presigned_url).with(:get, expires_in: 1800)
|
840
|
+
expect(object).to receive(:presigned_url).with(:get, { expires_in: 1800 })
|
758
841
|
@dummy.avatar.expiring_url(1800, :thumb)
|
759
842
|
end
|
760
843
|
|
761
844
|
it "generates a url for the default style" do
|
762
845
|
object = double
|
763
846
|
allow(@dummy.avatar).to receive(:s3_object).with(:original).and_return(object)
|
764
|
-
expect(object).to receive(:presigned_url).with(:get, expires_in: 1800)
|
847
|
+
expect(object).to receive(:presigned_url).with(:get, { expires_in: 1800 })
|
765
848
|
@dummy.avatar.expiring_url(1800)
|
766
849
|
end
|
767
850
|
end
|
@@ -906,7 +989,7 @@ describe Paperclip::Storage::S3 do
|
|
906
989
|
object = double
|
907
990
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
908
991
|
expect(object).to receive(:upload_file).
|
909
|
-
with(anything, content_type: "image/png", acl: :"public-read")
|
992
|
+
with(anything, { content_type: "image/png", acl: :"public-read" })
|
910
993
|
@dummy.save
|
911
994
|
end
|
912
995
|
|
@@ -1066,10 +1149,14 @@ describe Paperclip::Storage::S3 do
|
|
1066
1149
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
1067
1150
|
|
1068
1151
|
expect(object).to receive(:upload_file).
|
1069
|
-
with(
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1152
|
+
with(
|
1153
|
+
anything,
|
1154
|
+
{
|
1155
|
+
content_type: "image/png",
|
1156
|
+
acl: :"public-read",
|
1157
|
+
cache_control: "max-age=31557600",
|
1158
|
+
},
|
1159
|
+
)
|
1073
1160
|
@dummy.save
|
1074
1161
|
end
|
1075
1162
|
|
@@ -1107,10 +1194,14 @@ describe Paperclip::Storage::S3 do
|
|
1107
1194
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
1108
1195
|
|
1109
1196
|
expect(object).to receive(:upload_file).
|
1110
|
-
with(
|
1197
|
+
with(
|
1198
|
+
anything,
|
1199
|
+
{
|
1111
1200
|
content_type: "image/png",
|
1112
1201
|
acl: :"public-read",
|
1113
|
-
metadata: { "color" => "red" }
|
1202
|
+
metadata: { "color" => "red" },
|
1203
|
+
},
|
1204
|
+
)
|
1114
1205
|
@dummy.save
|
1115
1206
|
end
|
1116
1207
|
|
@@ -1148,10 +1239,14 @@ describe Paperclip::Storage::S3 do
|
|
1148
1239
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
1149
1240
|
|
1150
1241
|
expect(object).to receive(:upload_file).
|
1151
|
-
with(
|
1242
|
+
with(
|
1243
|
+
anything,
|
1244
|
+
{
|
1152
1245
|
content_type: "image/png",
|
1153
1246
|
acl: :"public-read",
|
1154
|
-
metadata: { "color" => "red" }
|
1247
|
+
metadata: { "color" => "red" },
|
1248
|
+
},
|
1249
|
+
)
|
1155
1250
|
@dummy.save
|
1156
1251
|
end
|
1157
1252
|
|
@@ -1190,10 +1285,14 @@ describe Paperclip::Storage::S3 do
|
|
1190
1285
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
1191
1286
|
|
1192
1287
|
expect(object).to receive(:upload_file).
|
1193
|
-
with(
|
1288
|
+
with(
|
1289
|
+
anything,
|
1290
|
+
{
|
1194
1291
|
content_type: "image/png",
|
1195
1292
|
acl: :"public-read",
|
1196
|
-
storage_class: "reduced_redundancy"
|
1293
|
+
storage_class: "reduced_redundancy",
|
1294
|
+
},
|
1295
|
+
)
|
1197
1296
|
@dummy.save
|
1198
1297
|
end
|
1199
1298
|
|
@@ -1286,9 +1385,14 @@ describe Paperclip::Storage::S3 do
|
|
1286
1385
|
allow(@dummy.avatar).to receive(:s3_object).with(style).and_return(object)
|
1287
1386
|
|
1288
1387
|
expect(object).to receive(:upload_file).
|
1289
|
-
with(
|
1290
|
-
|
1291
|
-
|
1388
|
+
with(
|
1389
|
+
anything,
|
1390
|
+
{
|
1391
|
+
content_type: "image/png",
|
1392
|
+
acl: :"public-read",
|
1393
|
+
storage_class: :reduced_redundancy,
|
1394
|
+
},
|
1395
|
+
)
|
1292
1396
|
end
|
1293
1397
|
@dummy.save
|
1294
1398
|
end
|
@@ -1331,7 +1435,7 @@ describe Paperclip::Storage::S3 do
|
|
1331
1435
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
1332
1436
|
|
1333
1437
|
expect(object).to receive(:upload_file).
|
1334
|
-
with(anything, content_type: "image/png", acl: :"public-read")
|
1438
|
+
with(anything, { content_type: "image/png", acl: :"public-read" })
|
1335
1439
|
@dummy.save
|
1336
1440
|
end
|
1337
1441
|
|
@@ -1370,9 +1474,14 @@ describe Paperclip::Storage::S3 do
|
|
1370
1474
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
1371
1475
|
|
1372
1476
|
expect(object).to receive(:upload_file).
|
1373
|
-
with(
|
1374
|
-
|
1375
|
-
|
1477
|
+
with(
|
1478
|
+
anything,
|
1479
|
+
{
|
1480
|
+
content_type: "image/png",
|
1481
|
+
acl: :"public-read",
|
1482
|
+
server_side_encryption: "AES256",
|
1483
|
+
},
|
1484
|
+
)
|
1376
1485
|
@dummy.save
|
1377
1486
|
end
|
1378
1487
|
|
@@ -1410,10 +1519,14 @@ describe Paperclip::Storage::S3 do
|
|
1410
1519
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
1411
1520
|
|
1412
1521
|
expect(object).to receive(:upload_file).
|
1413
|
-
with(
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1522
|
+
with(
|
1523
|
+
anything,
|
1524
|
+
{
|
1525
|
+
content_type: "image/png",
|
1526
|
+
acl: :"public-read",
|
1527
|
+
storage_class: :reduced_redundancy,
|
1528
|
+
},
|
1529
|
+
)
|
1417
1530
|
@dummy.save
|
1418
1531
|
end
|
1419
1532
|
|
@@ -1557,7 +1670,7 @@ describe Paperclip::Storage::S3 do
|
|
1557
1670
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
1558
1671
|
|
1559
1672
|
expect(object).to receive(:upload_file).
|
1560
|
-
with(anything, content_type: "image/png", acl: :"public-read")
|
1673
|
+
with(anything, { content_type: "image/png", acl: :"public-read" })
|
1561
1674
|
@dummy.save
|
1562
1675
|
end
|
1563
1676
|
|
@@ -1595,7 +1708,7 @@ describe Paperclip::Storage::S3 do
|
|
1595
1708
|
allow(@dummy.avatar).to receive(:s3_object).and_return(object)
|
1596
1709
|
|
1597
1710
|
expect(object).to receive(:upload_file).
|
1598
|
-
with(anything, content_type: "image/png", acl: :private)
|
1711
|
+
with(anything, { content_type: "image/png", acl: :private })
|
1599
1712
|
@dummy.save
|
1600
1713
|
end
|
1601
1714
|
|
@@ -1641,8 +1754,10 @@ describe Paperclip::Storage::S3 do
|
|
1641
1754
|
|
1642
1755
|
expect(object).to receive(:upload_file).
|
1643
1756
|
with(anything,
|
1644
|
-
|
1645
|
-
|
1757
|
+
{
|
1758
|
+
content_type: "image/png",
|
1759
|
+
acl: style == :thumb ? :public_read : :private
|
1760
|
+
})
|
1646
1761
|
end
|
1647
1762
|
@dummy.save
|
1648
1763
|
end
|
@@ -1711,10 +1826,14 @@ describe Paperclip::Storage::S3 do
|
|
1711
1826
|
allow(@dummy.avatar).to receive(:s3_object).with(style).and_return(object)
|
1712
1827
|
|
1713
1828
|
expect(object).to receive(:upload_file).
|
1714
|
-
with(
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1829
|
+
with(
|
1830
|
+
anything,
|
1831
|
+
{
|
1832
|
+
content_type: "image/png",
|
1833
|
+
acl: :"public-read",
|
1834
|
+
content_disposition: 'attachment; filename="Custom Avatar Name.png"',
|
1835
|
+
},
|
1836
|
+
)
|
1718
1837
|
end
|
1719
1838
|
@dummy.save
|
1720
1839
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -21,6 +21,7 @@ FIXTURES_DIR = File.join(File.dirname(__FILE__), "fixtures")
|
|
21
21
|
config = YAML::safe_load(IO.read(File.dirname(__FILE__) + "/database.yml"))
|
22
22
|
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
|
23
23
|
ActiveRecord::Base.establish_connection(config["test"])
|
24
|
+
ActiveRecord::Migration.verbose = false
|
24
25
|
if ActiveRecord::VERSION::STRING >= "4.2" &&
|
25
26
|
ActiveRecord::VERSION::STRING < "5.0"
|
26
27
|
ActiveRecord::Base.raise_in_transactional_callbacks = true
|
@@ -28,15 +28,15 @@ module ModelReconstruction
|
|
28
28
|
|
29
29
|
def reset_table(_table_name, &block)
|
30
30
|
block ||= lambda { |_table| true }
|
31
|
-
ActiveRecord::
|
31
|
+
ActiveRecord::Migration.create_table :dummies, **{ force: true }, &block
|
32
32
|
end
|
33
33
|
|
34
34
|
def modify_table(&block)
|
35
|
-
ActiveRecord::
|
35
|
+
ActiveRecord::Migration.change_table :dummies, &block
|
36
36
|
end
|
37
37
|
|
38
38
|
def rebuild_model(options = {})
|
39
|
-
ActiveRecord::
|
39
|
+
ActiveRecord::Migration.create_table :dummies, force: true do |table|
|
40
40
|
table.column :title, :string
|
41
41
|
table.column :other, :string
|
42
42
|
table.column :avatar_file_name, :string
|
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: 7.
|
4
|
+
version: 7.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Surendra Singhi
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -70,16 +70,22 @@ dependencies:
|
|
70
70
|
name: terrapin
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 0.6.0
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '2.0'
|
76
79
|
type: :runtime
|
77
80
|
prerelease: false
|
78
81
|
version_requirements: !ruby/object:Gem::Requirement
|
79
82
|
requirements:
|
80
|
-
- - "
|
83
|
+
- - ">="
|
81
84
|
- !ruby/object:Gem::Version
|
82
85
|
version: 0.6.0
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '2.0'
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: activerecord
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -428,6 +434,7 @@ files:
|
|
428
434
|
- lib/paperclip/io_adapters/uploaded_file_adapter.rb
|
429
435
|
- lib/paperclip/io_adapters/uri_adapter.rb
|
430
436
|
- lib/paperclip/locales/en.yml
|
437
|
+
- lib/paperclip/locales/gd.yml
|
431
438
|
- lib/paperclip/logger.rb
|
432
439
|
- lib/paperclip/matchers.rb
|
433
440
|
- lib/paperclip/matchers/have_attached_file_matcher.rb
|
@@ -587,8 +594,114 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
587
594
|
version: '0'
|
588
595
|
requirements:
|
589
596
|
- ImageMagick
|
590
|
-
rubygems_version: 3.
|
591
|
-
signing_key:
|
597
|
+
rubygems_version: 3.1.6
|
598
|
+
signing_key:
|
592
599
|
specification_version: 4
|
593
600
|
summary: File attachments as attributes for ActiveRecord
|
594
|
-
test_files:
|
601
|
+
test_files:
|
602
|
+
- features/basic_integration.feature
|
603
|
+
- features/migration.feature
|
604
|
+
- features/rake_tasks.feature
|
605
|
+
- features/step_definitions/attachment_steps.rb
|
606
|
+
- features/step_definitions/html_steps.rb
|
607
|
+
- features/step_definitions/rails_steps.rb
|
608
|
+
- features/step_definitions/s3_steps.rb
|
609
|
+
- features/step_definitions/web_steps.rb
|
610
|
+
- features/support/env.rb
|
611
|
+
- features/support/fakeweb.rb
|
612
|
+
- features/support/file_helpers.rb
|
613
|
+
- features/support/fixtures/boot_config.txt
|
614
|
+
- features/support/fixtures/gemfile.txt
|
615
|
+
- features/support/fixtures/preinitializer.txt
|
616
|
+
- features/support/paths.rb
|
617
|
+
- features/support/rails.rb
|
618
|
+
- features/support/selectors.rb
|
619
|
+
- spec/database.yml
|
620
|
+
- spec/paperclip/attachment_definitions_spec.rb
|
621
|
+
- spec/paperclip/attachment_processing_spec.rb
|
622
|
+
- spec/paperclip/attachment_registry_spec.rb
|
623
|
+
- spec/paperclip/attachment_spec.rb
|
624
|
+
- spec/paperclip/content_type_detector_spec.rb
|
625
|
+
- spec/paperclip/file_command_content_type_detector_spec.rb
|
626
|
+
- spec/paperclip/filename_cleaner_spec.rb
|
627
|
+
- spec/paperclip/geometry_detector_spec.rb
|
628
|
+
- spec/paperclip/geometry_parser_spec.rb
|
629
|
+
- spec/paperclip/geometry_spec.rb
|
630
|
+
- spec/paperclip/glue_spec.rb
|
631
|
+
- spec/paperclip/has_attached_file_spec.rb
|
632
|
+
- spec/paperclip/integration_spec.rb
|
633
|
+
- spec/paperclip/interpolations_spec.rb
|
634
|
+
- spec/paperclip/io_adapters/abstract_adapter_spec.rb
|
635
|
+
- spec/paperclip/io_adapters/attachment_adapter_spec.rb
|
636
|
+
- spec/paperclip/io_adapters/data_uri_adapter_spec.rb
|
637
|
+
- spec/paperclip/io_adapters/empty_string_adapter_spec.rb
|
638
|
+
- spec/paperclip/io_adapters/file_adapter_spec.rb
|
639
|
+
- spec/paperclip/io_adapters/http_url_proxy_adapter_spec.rb
|
640
|
+
- spec/paperclip/io_adapters/identity_adapter_spec.rb
|
641
|
+
- spec/paperclip/io_adapters/nil_adapter_spec.rb
|
642
|
+
- spec/paperclip/io_adapters/registry_spec.rb
|
643
|
+
- spec/paperclip/io_adapters/stringio_adapter_spec.rb
|
644
|
+
- spec/paperclip/io_adapters/uploaded_file_adapter_spec.rb
|
645
|
+
- spec/paperclip/io_adapters/uri_adapter_spec.rb
|
646
|
+
- spec/paperclip/matchers/have_attached_file_matcher_spec.rb
|
647
|
+
- spec/paperclip/matchers/validate_attachment_content_type_matcher_spec.rb
|
648
|
+
- spec/paperclip/matchers/validate_attachment_presence_matcher_spec.rb
|
649
|
+
- spec/paperclip/matchers/validate_attachment_size_matcher_spec.rb
|
650
|
+
- spec/paperclip/media_type_spoof_detector_spec.rb
|
651
|
+
- spec/paperclip/meta_class_spec.rb
|
652
|
+
- spec/paperclip/paperclip_missing_attachment_styles_spec.rb
|
653
|
+
- spec/paperclip/paperclip_spec.rb
|
654
|
+
- spec/paperclip/plural_cache_spec.rb
|
655
|
+
- spec/paperclip/processor_helpers_spec.rb
|
656
|
+
- spec/paperclip/processor_spec.rb
|
657
|
+
- spec/paperclip/rails_environment_spec.rb
|
658
|
+
- spec/paperclip/rake_spec.rb
|
659
|
+
- spec/paperclip/schema_spec.rb
|
660
|
+
- spec/paperclip/storage/filesystem_spec.rb
|
661
|
+
- spec/paperclip/storage/fog_spec.rb
|
662
|
+
- spec/paperclip/storage/s3_live_spec.rb
|
663
|
+
- spec/paperclip/storage/s3_spec.rb
|
664
|
+
- spec/paperclip/style_spec.rb
|
665
|
+
- spec/paperclip/tempfile_factory_spec.rb
|
666
|
+
- spec/paperclip/tempfile_spec.rb
|
667
|
+
- spec/paperclip/thumbnail_spec.rb
|
668
|
+
- spec/paperclip/url_generator_spec.rb
|
669
|
+
- spec/paperclip/validators/attachment_content_type_validator_spec.rb
|
670
|
+
- spec/paperclip/validators/attachment_file_name_validator_spec.rb
|
671
|
+
- spec/paperclip/validators/attachment_presence_validator_spec.rb
|
672
|
+
- spec/paperclip/validators/attachment_size_validator_spec.rb
|
673
|
+
- spec/paperclip/validators/media_type_spoof_detection_validator_spec.rb
|
674
|
+
- spec/paperclip/validators_spec.rb
|
675
|
+
- spec/spec_helper.rb
|
676
|
+
- spec/support/assertions.rb
|
677
|
+
- spec/support/fake_model.rb
|
678
|
+
- spec/support/fake_rails.rb
|
679
|
+
- spec/support/fixtures/12k.png
|
680
|
+
- spec/support/fixtures/50x50.png
|
681
|
+
- spec/support/fixtures/5k.png
|
682
|
+
- spec/support/fixtures/animated
|
683
|
+
- spec/support/fixtures/animated.gif
|
684
|
+
- spec/support/fixtures/animated.unknown
|
685
|
+
- spec/support/fixtures/aws_s3.yml
|
686
|
+
- spec/support/fixtures/bad.png
|
687
|
+
- spec/support/fixtures/empty.html
|
688
|
+
- spec/support/fixtures/empty.xlsx
|
689
|
+
- spec/support/fixtures/fog.yml
|
690
|
+
- spec/support/fixtures/rotated.jpg
|
691
|
+
- spec/support/fixtures/s3.yml
|
692
|
+
- spec/support/fixtures/sample.xlsm
|
693
|
+
- spec/support/fixtures/spaced file.jpg
|
694
|
+
- spec/support/fixtures/spaced file.png
|
695
|
+
- spec/support/fixtures/text.txt
|
696
|
+
- spec/support/fixtures/twopage.pdf
|
697
|
+
- spec/support/fixtures/uppercase.PNG
|
698
|
+
- spec/support/matchers/accept.rb
|
699
|
+
- spec/support/matchers/exist.rb
|
700
|
+
- spec/support/matchers/have_column.rb
|
701
|
+
- spec/support/mock_attachment.rb
|
702
|
+
- spec/support/mock_interpolator.rb
|
703
|
+
- spec/support/mock_url_generator_builder.rb
|
704
|
+
- spec/support/model_reconstruction.rb
|
705
|
+
- spec/support/reporting.rb
|
706
|
+
- spec/support/test_data.rb
|
707
|
+
- spec/support/version_helper.rb
|