paperclip 4.2.1 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.hound.yml +1066 -0
- data/.rubocop.yml +1 -0
- data/.travis.yml +5 -3
- data/Appraisals +2 -7
- data/CONTRIBUTING.md +3 -3
- data/Gemfile +2 -1
- data/LICENSE +1 -1
- data/NEWS +57 -30
- data/README.md +137 -77
- data/RELEASING.md +17 -0
- data/Rakefile +1 -1
- data/features/basic_integration.feature +7 -4
- data/features/step_definitions/attachment_steps.rb +7 -1
- data/gemfiles/3.2.gemfile +2 -1
- data/gemfiles/4.1.gemfile +2 -1
- data/gemfiles/4.2.gemfile +3 -2
- data/lib/paperclip/attachment.rb +3 -1
- data/lib/paperclip/attachment_registry.rb +1 -1
- data/lib/paperclip/content_type_detector.rb +26 -11
- data/lib/paperclip/file_command_content_type_detector.rb +6 -8
- data/lib/paperclip/glue.rb +1 -1
- data/lib/paperclip/has_attached_file.rb +2 -1
- data/lib/paperclip/interpolations.rb +1 -1
- data/lib/paperclip/io_adapters/abstract_adapter.rb +1 -0
- data/lib/paperclip/locales/en.yml +1 -1
- data/lib/paperclip/media_type_spoof_detector.rb +38 -18
- data/lib/paperclip/rails_environment.rb +25 -0
- data/lib/paperclip/storage/fog.rb +4 -4
- data/lib/paperclip/storage/s3.rb +2 -3
- data/lib/paperclip/thumbnail.rb +2 -3
- data/lib/paperclip/validators/media_type_spoof_detection_validator.rb +1 -1
- data/lib/paperclip/version.rb +1 -1
- data/lib/paperclip.rb +13 -3
- data/lib/tasks/paperclip.rake +16 -0
- data/paperclip.gemspec +9 -10
- data/spec/paperclip/attachment_definitions_spec.rb +1 -1
- data/spec/paperclip/attachment_registry_spec.rb +56 -13
- data/spec/paperclip/attachment_spec.rb +57 -19
- data/spec/paperclip/content_type_detector_spec.rb +8 -1
- data/spec/paperclip/file_command_content_type_detector_spec.rb +0 -1
- data/spec/paperclip/interpolations_spec.rb +2 -9
- data/spec/paperclip/io_adapters/abstract_adapter_spec.rb +2 -1
- data/spec/paperclip/io_adapters/file_adapter_spec.rb +4 -1
- data/spec/paperclip/io_adapters/stringio_adapter_spec.rb +4 -0
- data/spec/paperclip/media_type_spoof_detector_spec.rb +31 -7
- data/spec/paperclip/paperclip_spec.rb +1 -1
- data/spec/paperclip/rails_environment_spec.rb +33 -0
- data/spec/paperclip/storage/fog_spec.rb +11 -2
- data/spec/paperclip/storage/s3_spec.rb +43 -25
- data/spec/paperclip/tempfile_factory_spec.rb +4 -0
- data/spec/paperclip/thumbnail_spec.rb +16 -0
- data/spec/paperclip/url_generator_spec.rb +1 -1
- data/spec/paperclip/validators/media_type_spoof_detection_validator_spec.rb +1 -1
- data/spec/support/fake_model.rb +4 -0
- data/spec/support/fixtures/empty.xlsx +0 -0
- data/spec/support/matchers/have_column.rb +11 -2
- metadata +49 -24
- data/RUNNING_TESTS.md +0 -4
- data/gemfiles/4.0.gemfile +0 -19
- data/spec/support/mock_model.rb +0 -2
data/spec/support/fake_model.rb
CHANGED
|
Binary file
|
|
@@ -8,7 +8,16 @@ RSpec::Matchers.define :have_column do |column_name|
|
|
|
8
8
|
column && column.default.to_s == @default.to_s
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
failure_message_method =
|
|
12
|
+
if RSpec::Version::STRING.to_i >= 3
|
|
13
|
+
:failure_message
|
|
14
|
+
else
|
|
15
|
+
:failure_message_for_should
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
send(failure_message_method) do |columns|
|
|
19
|
+
"expected to find '#{column_name}', " +
|
|
20
|
+
"default '#{@default}' " +
|
|
21
|
+
"in #{columns.map { |column| [column.name, column.default] }}"
|
|
13
22
|
end
|
|
14
23
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: paperclip
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jon Yurek
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|
|
@@ -16,42 +16,42 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 3.
|
|
19
|
+
version: 3.2.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 3.
|
|
26
|
+
version: 3.2.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: activesupport
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 3.
|
|
33
|
+
version: 3.2.0
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 3.
|
|
40
|
+
version: 3.2.0
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: cocaine
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 0.5.
|
|
47
|
+
version: 0.5.5
|
|
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: 0.5.
|
|
54
|
+
version: 0.5.5
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: mime-types
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,20 +66,34 @@ dependencies:
|
|
|
66
66
|
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: mimemagic
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - '='
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: 0.3.0
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - '='
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: 0.3.0
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
84
|
name: activerecord
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
72
86
|
requirements:
|
|
73
87
|
- - ">="
|
|
74
88
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 3.
|
|
89
|
+
version: 3.2.0
|
|
76
90
|
type: :development
|
|
77
91
|
prerelease: false
|
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
93
|
requirements:
|
|
80
94
|
- - ">="
|
|
81
95
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: 3.
|
|
96
|
+
version: 3.2.0
|
|
83
97
|
- !ruby/object:Gem::Dependency
|
|
84
98
|
name: shoulda
|
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -143,6 +157,9 @@ dependencies:
|
|
|
143
157
|
- - ">="
|
|
144
158
|
- !ruby/object:Gem::Version
|
|
145
159
|
version: 1.5.7
|
|
160
|
+
- - "<="
|
|
161
|
+
- !ruby/object:Gem::Version
|
|
162
|
+
version: '2.0'
|
|
146
163
|
type: :development
|
|
147
164
|
prerelease: false
|
|
148
165
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -150,6 +167,9 @@ dependencies:
|
|
|
150
167
|
- - ">="
|
|
151
168
|
- !ruby/object:Gem::Version
|
|
152
169
|
version: 1.5.7
|
|
170
|
+
- - "<="
|
|
171
|
+
- !ruby/object:Gem::Version
|
|
172
|
+
version: '2.0'
|
|
153
173
|
- !ruby/object:Gem::Dependency
|
|
154
174
|
name: bourne
|
|
155
175
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -170,14 +190,14 @@ dependencies:
|
|
|
170
190
|
requirements:
|
|
171
191
|
- - "~>"
|
|
172
192
|
- !ruby/object:Gem::Version
|
|
173
|
-
version: 1.3.
|
|
193
|
+
version: 1.3.18
|
|
174
194
|
type: :development
|
|
175
195
|
prerelease: false
|
|
176
196
|
version_requirements: !ruby/object:Gem::Requirement
|
|
177
197
|
requirements:
|
|
178
198
|
- - "~>"
|
|
179
199
|
- !ruby/object:Gem::Version
|
|
180
|
-
version: 1.3.
|
|
200
|
+
version: 1.3.18
|
|
181
201
|
- !ruby/object:Gem::Dependency
|
|
182
202
|
name: aruba
|
|
183
203
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -210,16 +230,16 @@ dependencies:
|
|
|
210
230
|
name: capybara
|
|
211
231
|
requirement: !ruby/object:Gem::Requirement
|
|
212
232
|
requirements:
|
|
213
|
-
- -
|
|
233
|
+
- - ">="
|
|
214
234
|
- !ruby/object:Gem::Version
|
|
215
|
-
version:
|
|
235
|
+
version: '0'
|
|
216
236
|
type: :development
|
|
217
237
|
prerelease: false
|
|
218
238
|
version_requirements: !ruby/object:Gem::Requirement
|
|
219
239
|
requirements:
|
|
220
|
-
- -
|
|
240
|
+
- - ">="
|
|
221
241
|
- !ruby/object:Gem::Version
|
|
222
|
-
version:
|
|
242
|
+
version: '0'
|
|
223
243
|
- !ruby/object:Gem::Dependency
|
|
224
244
|
name: bundler
|
|
225
245
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -310,14 +330,14 @@ dependencies:
|
|
|
310
330
|
requirements:
|
|
311
331
|
- - ">="
|
|
312
332
|
- !ruby/object:Gem::Version
|
|
313
|
-
version: 3.
|
|
333
|
+
version: 3.2.0
|
|
314
334
|
type: :development
|
|
315
335
|
prerelease: false
|
|
316
336
|
version_requirements: !ruby/object:Gem::Requirement
|
|
317
337
|
requirements:
|
|
318
338
|
- - ">="
|
|
319
339
|
- !ruby/object:Gem::Version
|
|
320
|
-
version: 3.
|
|
340
|
+
version: 3.2.0
|
|
321
341
|
- !ruby/object:Gem::Dependency
|
|
322
342
|
name: generator_spec
|
|
323
343
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -354,6 +374,8 @@ extensions: []
|
|
|
354
374
|
extra_rdoc_files: []
|
|
355
375
|
files:
|
|
356
376
|
- ".gitignore"
|
|
377
|
+
- ".hound.yml"
|
|
378
|
+
- ".rubocop.yml"
|
|
357
379
|
- ".travis.yml"
|
|
358
380
|
- Appraisals
|
|
359
381
|
- CONTRIBUTING.md
|
|
@@ -361,7 +383,7 @@ files:
|
|
|
361
383
|
- LICENSE
|
|
362
384
|
- NEWS
|
|
363
385
|
- README.md
|
|
364
|
-
-
|
|
386
|
+
- RELEASING.md
|
|
365
387
|
- Rakefile
|
|
366
388
|
- UPGRADING
|
|
367
389
|
- cucumber/paperclip_steps.rb
|
|
@@ -383,7 +405,6 @@ files:
|
|
|
383
405
|
- features/support/rails.rb
|
|
384
406
|
- features/support/selectors.rb
|
|
385
407
|
- gemfiles/3.2.gemfile
|
|
386
|
-
- gemfiles/4.0.gemfile
|
|
387
408
|
- gemfiles/4.1.gemfile
|
|
388
409
|
- gemfiles/4.2.gemfile
|
|
389
410
|
- lib/generators/paperclip/USAGE
|
|
@@ -435,6 +456,7 @@ files:
|
|
|
435
456
|
- lib/paperclip/missing_attachment_styles.rb
|
|
436
457
|
- lib/paperclip/processor.rb
|
|
437
458
|
- lib/paperclip/processor_helpers.rb
|
|
459
|
+
- lib/paperclip/rails_environment.rb
|
|
438
460
|
- lib/paperclip/railtie.rb
|
|
439
461
|
- lib/paperclip/schema.rb
|
|
440
462
|
- lib/paperclip/storage.rb
|
|
@@ -494,6 +516,7 @@ files:
|
|
|
494
516
|
- spec/paperclip/plural_cache_spec.rb
|
|
495
517
|
- spec/paperclip/processor_helpers_spec.rb
|
|
496
518
|
- spec/paperclip/processor_spec.rb
|
|
519
|
+
- spec/paperclip/rails_environment_spec.rb
|
|
497
520
|
- spec/paperclip/rake_spec.rb
|
|
498
521
|
- spec/paperclip/schema_spec.rb
|
|
499
522
|
- spec/paperclip/storage/filesystem_spec.rb
|
|
@@ -522,6 +545,7 @@ files:
|
|
|
522
545
|
- spec/support/fixtures/animated.unknown
|
|
523
546
|
- spec/support/fixtures/bad.png
|
|
524
547
|
- spec/support/fixtures/empty.html
|
|
548
|
+
- spec/support/fixtures/empty.xlsx
|
|
525
549
|
- spec/support/fixtures/fog.yml
|
|
526
550
|
- spec/support/fixtures/rotated.jpg
|
|
527
551
|
- spec/support/fixtures/s3.yml
|
|
@@ -535,7 +559,6 @@ files:
|
|
|
535
559
|
- spec/support/matchers/have_column.rb
|
|
536
560
|
- spec/support/mock_attachment.rb
|
|
537
561
|
- spec/support/mock_interpolator.rb
|
|
538
|
-
- spec/support/mock_model.rb
|
|
539
562
|
- spec/support/mock_url_generator_builder.rb
|
|
540
563
|
- spec/support/model_reconstruction.rb
|
|
541
564
|
- spec/support/rails_helpers.rb
|
|
@@ -561,8 +584,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
561
584
|
version: '0'
|
|
562
585
|
requirements:
|
|
563
586
|
- ImageMagick
|
|
564
|
-
rubyforge_project:
|
|
565
|
-
rubygems_version: 2.
|
|
587
|
+
rubyforge_project:
|
|
588
|
+
rubygems_version: 2.4.5
|
|
566
589
|
signing_key:
|
|
567
590
|
specification_version: 4
|
|
568
591
|
summary: File attachments as attributes for ActiveRecord
|
|
@@ -621,6 +644,7 @@ test_files:
|
|
|
621
644
|
- spec/paperclip/plural_cache_spec.rb
|
|
622
645
|
- spec/paperclip/processor_helpers_spec.rb
|
|
623
646
|
- spec/paperclip/processor_spec.rb
|
|
647
|
+
- spec/paperclip/rails_environment_spec.rb
|
|
624
648
|
- spec/paperclip/rake_spec.rb
|
|
625
649
|
- spec/paperclip/schema_spec.rb
|
|
626
650
|
- spec/paperclip/storage/filesystem_spec.rb
|
|
@@ -649,6 +673,7 @@ test_files:
|
|
|
649
673
|
- spec/support/fixtures/animated.unknown
|
|
650
674
|
- spec/support/fixtures/bad.png
|
|
651
675
|
- spec/support/fixtures/empty.html
|
|
676
|
+
- spec/support/fixtures/empty.xlsx
|
|
652
677
|
- spec/support/fixtures/fog.yml
|
|
653
678
|
- spec/support/fixtures/rotated.jpg
|
|
654
679
|
- spec/support/fixtures/s3.yml
|
|
@@ -662,9 +687,9 @@ test_files:
|
|
|
662
687
|
- spec/support/matchers/have_column.rb
|
|
663
688
|
- spec/support/mock_attachment.rb
|
|
664
689
|
- spec/support/mock_interpolator.rb
|
|
665
|
-
- spec/support/mock_model.rb
|
|
666
690
|
- spec/support/mock_url_generator_builder.rb
|
|
667
691
|
- spec/support/model_reconstruction.rb
|
|
668
692
|
- spec/support/rails_helpers.rb
|
|
669
693
|
- spec/support/test_data.rb
|
|
670
694
|
- spec/support/version_helper.rb
|
|
695
|
+
has_rdoc:
|
data/RUNNING_TESTS.md
DELETED
data/gemfiles/4.0.gemfile
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# This file was generated by Appraisal
|
|
2
|
-
|
|
3
|
-
source "https://rubygems.org"
|
|
4
|
-
|
|
5
|
-
gem "sqlite3", "1.3.8", :platforms => :ruby
|
|
6
|
-
gem "jruby-openssl", :platforms => :jruby
|
|
7
|
-
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
|
8
|
-
gem "rubysl", :platforms => :rbx
|
|
9
|
-
gem "racc", :platforms => :rbx
|
|
10
|
-
gem "pry"
|
|
11
|
-
gem "rails", "~> 4.0.0"
|
|
12
|
-
gem "paperclip", :path => "../"
|
|
13
|
-
|
|
14
|
-
group :development, :test do
|
|
15
|
-
gem "mime-types", "~> 1.16"
|
|
16
|
-
gem "builder"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
gemspec :path => "../"
|
data/spec/support/mock_model.rb
DELETED