kt-paperclip 4.4.0 → 5.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +17 -0
- data/.hound.yml +5 -16
- data/.travis.yml +15 -12
- data/Appraisals +4 -8
- data/CONTRIBUTING.md +16 -5
- data/Gemfile +3 -8
- data/LICENSE +1 -1
- data/NEWS +105 -31
- data/README.md +239 -153
- data/Rakefile +1 -1
- data/UPGRADING +12 -9
- data/features/basic_integration.feature +3 -2
- data/features/migration.feature +0 -24
- data/features/step_definitions/attachment_steps.rb +6 -6
- data/features/step_definitions/rails_steps.rb +29 -28
- data/features/step_definitions/s3_steps.rb +2 -2
- data/features/support/env.rb +1 -0
- data/features/support/paths.rb +1 -1
- data/features/support/rails.rb +0 -24
- data/gemfiles/4.2.gemfile +3 -5
- data/gemfiles/{3.2.gemfile → 5.0.gemfile} +4 -6
- data/lib/generators/paperclip/paperclip_generator.rb +9 -1
- data/lib/generators/paperclip/templates/paperclip_migration.rb.erb +1 -1
- data/lib/paperclip/attachment.rb +25 -14
- data/lib/paperclip/attachment_registry.rb +2 -1
- data/lib/paperclip/callbacks.rb +8 -6
- data/lib/paperclip/content_type_detector.rb +3 -2
- data/lib/paperclip/errors.rb +3 -1
- data/lib/paperclip/file_command_content_type_detector.rb +1 -1
- data/lib/paperclip/geometry_detector_factory.rb +2 -2
- data/lib/paperclip/glue.rb +1 -1
- data/lib/paperclip/has_attached_file.rb +7 -1
- data/lib/paperclip/helpers.rb +15 -11
- data/lib/paperclip/interpolations.rb +1 -1
- data/lib/paperclip/io_adapters/abstract_adapter.rb +29 -3
- data/lib/paperclip/io_adapters/attachment_adapter.rb +10 -5
- data/lib/paperclip/io_adapters/data_uri_adapter.rb +8 -8
- data/lib/paperclip/io_adapters/empty_string_adapter.rb +5 -4
- data/lib/paperclip/io_adapters/file_adapter.rb +12 -6
- data/lib/paperclip/io_adapters/http_url_proxy_adapter.rb +7 -7
- data/lib/paperclip/io_adapters/identity_adapter.rb +12 -6
- data/lib/paperclip/io_adapters/nil_adapter.rb +8 -5
- data/lib/paperclip/io_adapters/registry.rb +6 -2
- data/lib/paperclip/io_adapters/stringio_adapter.rb +9 -6
- data/lib/paperclip/io_adapters/uploaded_file_adapter.rb +10 -6
- data/lib/paperclip/io_adapters/uri_adapter.rb +17 -14
- data/lib/paperclip/matchers/validate_attachment_content_type_matcher.rb +4 -4
- data/lib/paperclip/media_type_spoof_detector.rb +3 -2
- data/lib/paperclip/processor.rb +5 -4
- data/lib/paperclip/schema.rb +4 -10
- data/lib/paperclip/storage/filesystem.rb +13 -2
- data/lib/paperclip/storage/fog.rb +19 -13
- data/lib/paperclip/storage/s3.rb +87 -58
- data/lib/paperclip/thumbnail.rb +18 -8
- data/lib/paperclip/url_generator.rb +18 -14
- data/lib/paperclip/validators/attachment_size_validator.rb +1 -7
- data/lib/paperclip/validators.rb +1 -1
- data/lib/paperclip/version.rb +3 -1
- data/lib/paperclip.rb +13 -12
- data/lib/tasks/paperclip.rake +18 -4
- data/paperclip.gemspec +13 -11
- data/spec/paperclip/attachment_processing_spec.rb +2 -4
- data/spec/paperclip/attachment_registry_spec.rb +28 -0
- data/spec/paperclip/attachment_spec.rb +72 -18
- data/spec/paperclip/content_type_detector_spec.rb +1 -1
- data/spec/paperclip/file_command_content_type_detector_spec.rb +15 -1
- data/spec/paperclip/has_attached_file_spec.rb +24 -8
- data/spec/paperclip/integration_spec.rb +4 -3
- data/spec/paperclip/io_adapters/abstract_adapter_spec.rb +76 -22
- data/spec/paperclip/io_adapters/attachment_adapter_spec.rb +6 -3
- data/spec/paperclip/io_adapters/data_uri_adapter_spec.rb +7 -1
- data/spec/paperclip/io_adapters/file_adapter_spec.rb +2 -2
- data/spec/paperclip/io_adapters/http_url_proxy_adapter_spec.rb +18 -1
- data/spec/paperclip/io_adapters/identity_adapter_spec.rb +1 -1
- data/spec/paperclip/io_adapters/registry_spec.rb +2 -2
- data/spec/paperclip/io_adapters/stringio_adapter_spec.rb +1 -1
- data/spec/paperclip/io_adapters/uploaded_file_adapter_spec.rb +5 -5
- data/spec/paperclip/io_adapters/uri_adapter_spec.rb +48 -3
- data/spec/paperclip/matchers/validate_attachment_content_type_matcher_spec.rb +10 -0
- data/spec/paperclip/media_type_spoof_detector_spec.rb +15 -0
- data/spec/paperclip/paperclip_spec.rb +15 -45
- data/spec/paperclip/processor_spec.rb +4 -4
- data/spec/paperclip/storage/fog_spec.rb +26 -0
- data/spec/paperclip/storage/s3_live_spec.rb +20 -14
- data/spec/paperclip/storage/s3_spec.rb +357 -190
- data/spec/paperclip/tempfile_spec.rb +35 -0
- data/spec/paperclip/thumbnail_spec.rb +38 -35
- data/spec/paperclip/url_generator_spec.rb +53 -42
- data/spec/paperclip/validators/attachment_size_validator_spec.rb +26 -20
- data/spec/paperclip/validators_spec.rb +5 -5
- data/spec/spec_helper.rb +6 -2
- data/spec/support/assertions.rb +12 -1
- data/spec/support/conditional_filter_helper.rb +5 -0
- data/spec/support/mock_attachment.rb +2 -0
- data/spec/support/mock_url_generator_builder.rb +2 -2
- data/spec/support/model_reconstruction.rb +10 -2
- data/spec/support/reporting.rb +11 -0
- metadata +69 -75
- data/cucumber/paperclip_steps.rb +0 -6
- data/gemfiles/4.1.gemfile +0 -19
- data/lib/paperclip/deprecations.rb +0 -42
- data/lib/paperclip/locales/de.yml +0 -18
- data/lib/paperclip/locales/es.yml +0 -18
- data/lib/paperclip/locales/ja.yml +0 -18
- data/lib/paperclip/locales/pt-BR.yml +0 -18
- data/lib/paperclip/locales/zh-CN.yml +0 -18
- data/lib/paperclip/locales/zh-HK.yml +0 -18
- data/lib/paperclip/locales/zh-TW.yml +0 -18
- data/spec/paperclip/deprecations_spec.rb +0 -65
- data/spec/support/deprecations.rb +0 -9
- data/spec/support/rails_helpers.rb +0 -7
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kt-paperclip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Surendra Singhi
|
@@ -16,54 +16,54 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.2.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '6.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 4.2.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '6.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: activesupport
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 4.2.0
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '6.0'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
49
|
+
version: 4.2.0
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
52
|
+
version: '6.0'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
|
-
name:
|
54
|
+
name: terrapin
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.
|
59
|
+
version: 0.6.0
|
60
60
|
type: :runtime
|
61
61
|
prerelease: false
|
62
62
|
version_requirements: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: 0.
|
66
|
+
version: 0.6.0
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: mime-types
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,40 +92,26 @@ dependencies:
|
|
92
92
|
- - "~>"
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: 0.3.8
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: bigdecimal
|
97
|
-
requirement: !ruby/object:Gem::Requirement
|
98
|
-
requirements:
|
99
|
-
- - '='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: 1.3.5
|
102
|
-
type: :runtime
|
103
|
-
prerelease: false
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
requirements:
|
106
|
-
- - '='
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
version: 1.3.5
|
109
95
|
- !ruby/object:Gem::Dependency
|
110
96
|
name: activerecord
|
111
97
|
requirement: !ruby/object:Gem::Requirement
|
112
98
|
requirements:
|
113
99
|
- - ">="
|
114
100
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
101
|
+
version: 4.2.0
|
116
102
|
- - "<"
|
117
103
|
- !ruby/object:Gem::Version
|
118
|
-
version: '
|
104
|
+
version: '6.0'
|
119
105
|
type: :development
|
120
106
|
prerelease: false
|
121
107
|
version_requirements: !ruby/object:Gem::Requirement
|
122
108
|
requirements:
|
123
109
|
- - ">="
|
124
110
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
111
|
+
version: 4.2.0
|
126
112
|
- - "<"
|
127
113
|
- !ruby/object:Gem::Version
|
128
|
-
version: '
|
114
|
+
version: '6.0'
|
129
115
|
- !ruby/object:Gem::Dependency
|
130
116
|
name: shoulda
|
131
117
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,20 +174,20 @@ dependencies:
|
|
188
174
|
requirements:
|
189
175
|
- - ">="
|
190
176
|
- !ruby/object:Gem::Version
|
191
|
-
version:
|
192
|
-
- - "
|
177
|
+
version: 2.3.0
|
178
|
+
- - "<"
|
193
179
|
- !ruby/object:Gem::Version
|
194
|
-
version: '
|
180
|
+
version: '3.0'
|
195
181
|
type: :development
|
196
182
|
prerelease: false
|
197
183
|
version_requirements: !ruby/object:Gem::Requirement
|
198
184
|
requirements:
|
199
185
|
- - ">="
|
200
186
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
202
|
-
- - "
|
187
|
+
version: 2.3.0
|
188
|
+
- - "<"
|
203
189
|
- !ruby/object:Gem::Version
|
204
|
-
version: '
|
190
|
+
version: '3.0'
|
205
191
|
- !ruby/object:Gem::Dependency
|
206
192
|
name: bourne
|
207
193
|
requirement: !ruby/object:Gem::Requirement
|
@@ -217,19 +203,33 @@ dependencies:
|
|
217
203
|
- !ruby/object:Gem::Version
|
218
204
|
version: '1.6'
|
219
205
|
- !ruby/object:Gem::Dependency
|
220
|
-
name: cucumber
|
206
|
+
name: cucumber-rails
|
221
207
|
requirement: !ruby/object:Gem::Requirement
|
222
208
|
requirements:
|
223
|
-
- - "
|
209
|
+
- - ">="
|
224
210
|
- !ruby/object:Gem::Version
|
225
|
-
version:
|
211
|
+
version: '0'
|
226
212
|
type: :development
|
227
213
|
prerelease: false
|
228
214
|
version_requirements: !ruby/object:Gem::Requirement
|
229
215
|
requirements:
|
230
|
-
- - "
|
216
|
+
- - ">="
|
231
217
|
- !ruby/object:Gem::Version
|
232
|
-
version:
|
218
|
+
version: '0'
|
219
|
+
- !ruby/object:Gem::Dependency
|
220
|
+
name: cucumber-expressions
|
221
|
+
requirement: !ruby/object:Gem::Requirement
|
222
|
+
requirements:
|
223
|
+
- - '='
|
224
|
+
- !ruby/object:Gem::Version
|
225
|
+
version: 4.0.3
|
226
|
+
type: :development
|
227
|
+
prerelease: false
|
228
|
+
version_requirements: !ruby/object:Gem::Requirement
|
229
|
+
requirements:
|
230
|
+
- - '='
|
231
|
+
- !ruby/object:Gem::Version
|
232
|
+
version: 4.0.3
|
233
233
|
- !ruby/object:Gem::Dependency
|
234
234
|
name: aruba
|
235
235
|
requirement: !ruby/object:Gem::Requirement
|
@@ -362,34 +362,20 @@ dependencies:
|
|
362
362
|
requirements:
|
363
363
|
- - ">="
|
364
364
|
- !ruby/object:Gem::Version
|
365
|
-
version:
|
366
|
-
type: :development
|
367
|
-
prerelease: false
|
368
|
-
version_requirements: !ruby/object:Gem::Requirement
|
369
|
-
requirements:
|
370
|
-
- - ">="
|
371
|
-
- !ruby/object:Gem::Version
|
372
|
-
version: '0'
|
373
|
-
- !ruby/object:Gem::Dependency
|
374
|
-
name: actionmailer
|
375
|
-
requirement: !ruby/object:Gem::Requirement
|
376
|
-
requirements:
|
377
|
-
- - ">="
|
378
|
-
- !ruby/object:Gem::Version
|
379
|
-
version: 3.2.0
|
365
|
+
version: 4.2.0
|
380
366
|
- - "<"
|
381
367
|
- !ruby/object:Gem::Version
|
382
|
-
version: '
|
368
|
+
version: '6.0'
|
383
369
|
type: :development
|
384
370
|
prerelease: false
|
385
371
|
version_requirements: !ruby/object:Gem::Requirement
|
386
372
|
requirements:
|
387
373
|
- - ">="
|
388
374
|
- !ruby/object:Gem::Version
|
389
|
-
version:
|
375
|
+
version: 4.2.0
|
390
376
|
- - "<"
|
391
377
|
- !ruby/object:Gem::Version
|
392
|
-
version: '
|
378
|
+
version: '6.0'
|
393
379
|
- !ruby/object:Gem::Dependency
|
394
380
|
name: generator_spec
|
395
381
|
requirement: !ruby/object:Gem::Requirement
|
@@ -425,6 +411,7 @@ executables: []
|
|
425
411
|
extensions: []
|
426
412
|
extra_rdoc_files: []
|
427
413
|
files:
|
414
|
+
- ".codeclimate.yml"
|
428
415
|
- ".gitignore"
|
429
416
|
- ".hound.yml"
|
430
417
|
- ".rubocop.yml"
|
@@ -438,7 +425,6 @@ files:
|
|
438
425
|
- RELEASING.md
|
439
426
|
- Rakefile
|
440
427
|
- UPGRADING
|
441
|
-
- cucumber/paperclip_steps.rb
|
442
428
|
- features/basic_integration.feature
|
443
429
|
- features/migration.feature
|
444
430
|
- features/rake_tasks.feature
|
@@ -456,9 +442,8 @@ files:
|
|
456
442
|
- features/support/paths.rb
|
457
443
|
- features/support/rails.rb
|
458
444
|
- features/support/selectors.rb
|
459
|
-
- gemfiles/3.2.gemfile
|
460
|
-
- gemfiles/4.1.gemfile
|
461
445
|
- gemfiles/4.2.gemfile
|
446
|
+
- gemfiles/5.0.gemfile
|
462
447
|
- lib/generators/paperclip/USAGE
|
463
448
|
- lib/generators/paperclip/paperclip_generator.rb
|
464
449
|
- lib/generators/paperclip/templates/paperclip_migration.rb.erb
|
@@ -468,7 +453,6 @@ files:
|
|
468
453
|
- lib/paperclip/attachment_registry.rb
|
469
454
|
- lib/paperclip/callbacks.rb
|
470
455
|
- lib/paperclip/content_type_detector.rb
|
471
|
-
- lib/paperclip/deprecations.rb
|
472
456
|
- lib/paperclip/errors.rb
|
473
457
|
- lib/paperclip/file_command_content_type_detector.rb
|
474
458
|
- lib/paperclip/filename_cleaner.rb
|
@@ -492,14 +476,7 @@ files:
|
|
492
476
|
- lib/paperclip/io_adapters/stringio_adapter.rb
|
493
477
|
- lib/paperclip/io_adapters/uploaded_file_adapter.rb
|
494
478
|
- lib/paperclip/io_adapters/uri_adapter.rb
|
495
|
-
- lib/paperclip/locales/de.yml
|
496
479
|
- lib/paperclip/locales/en.yml
|
497
|
-
- lib/paperclip/locales/es.yml
|
498
|
-
- lib/paperclip/locales/ja.yml
|
499
|
-
- lib/paperclip/locales/pt-BR.yml
|
500
|
-
- lib/paperclip/locales/zh-CN.yml
|
501
|
-
- lib/paperclip/locales/zh-HK.yml
|
502
|
-
- lib/paperclip/locales/zh-TW.yml
|
503
480
|
- lib/paperclip/logger.rb
|
504
481
|
- lib/paperclip/matchers.rb
|
505
482
|
- lib/paperclip/matchers/have_attached_file_matcher.rb
|
@@ -539,7 +516,6 @@ files:
|
|
539
516
|
- spec/paperclip/attachment_registry_spec.rb
|
540
517
|
- spec/paperclip/attachment_spec.rb
|
541
518
|
- spec/paperclip/content_type_detector_spec.rb
|
542
|
-
- spec/paperclip/deprecations_spec.rb
|
543
519
|
- spec/paperclip/file_command_content_type_detector_spec.rb
|
544
520
|
- spec/paperclip/filename_cleaner_spec.rb
|
545
521
|
- spec/paperclip/geometry_detector_spec.rb
|
@@ -581,6 +557,7 @@ files:
|
|
581
557
|
- spec/paperclip/storage/s3_spec.rb
|
582
558
|
- spec/paperclip/style_spec.rb
|
583
559
|
- spec/paperclip/tempfile_factory_spec.rb
|
560
|
+
- spec/paperclip/tempfile_spec.rb
|
584
561
|
- spec/paperclip/thumbnail_spec.rb
|
585
562
|
- spec/paperclip/url_generator_spec.rb
|
586
563
|
- spec/paperclip/validators/attachment_content_type_validator_spec.rb
|
@@ -591,7 +568,7 @@ files:
|
|
591
568
|
- spec/paperclip/validators_spec.rb
|
592
569
|
- spec/spec_helper.rb
|
593
570
|
- spec/support/assertions.rb
|
594
|
-
- spec/support/
|
571
|
+
- spec/support/conditional_filter_helper.rb
|
595
572
|
- spec/support/fake_model.rb
|
596
573
|
- spec/support/fake_rails.rb
|
597
574
|
- spec/support/fixtures/12k.png
|
@@ -618,14 +595,31 @@ files:
|
|
618
595
|
- spec/support/mock_interpolator.rb
|
619
596
|
- spec/support/mock_url_generator_builder.rb
|
620
597
|
- spec/support/model_reconstruction.rb
|
621
|
-
- spec/support/
|
598
|
+
- spec/support/reporting.rb
|
622
599
|
- spec/support/test_data.rb
|
623
600
|
- spec/support/version_helper.rb
|
624
601
|
homepage: https://github.com/kreeti/kt-paperclip
|
625
602
|
licenses:
|
626
603
|
- MIT
|
627
604
|
metadata: {}
|
628
|
-
post_install_message:
|
605
|
+
post_install_message: |
|
606
|
+
##################################################
|
607
|
+
# NOTE FOR UPGRADING FROM 4.3.0 OR EARLIER #
|
608
|
+
##################################################
|
609
|
+
|
610
|
+
Paperclip is now compatible with aws-sdk >= 2.0.0.
|
611
|
+
|
612
|
+
If you are using S3 storage, aws-sdk >= 2.0.0 requires you to make a few small
|
613
|
+
changes:
|
614
|
+
|
615
|
+
* You must set the `s3_region`
|
616
|
+
* If you are explicitly setting permissions anywhere, such as in an initializer,
|
617
|
+
note that the format of the permissions changed from using an underscore to
|
618
|
+
using a hyphen. For example, `:public_read` needs to be changed to
|
619
|
+
`public-read`.
|
620
|
+
|
621
|
+
For a walkthrough of upgrading from 4 to 5 and aws-sdk >= 2.0 you can watch
|
622
|
+
http://rubythursday.com/episodes/ruby-snack-27-upgrade-paperclip-and-aws-sdk-in-prep-for-rails-5
|
629
623
|
rdoc_options: []
|
630
624
|
require_paths:
|
631
625
|
- lib
|
@@ -633,7 +627,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
633
627
|
requirements:
|
634
628
|
- - ">="
|
635
629
|
- !ruby/object:Gem::Version
|
636
|
-
version: 1.
|
630
|
+
version: 2.1.0
|
637
631
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
638
632
|
requirements:
|
639
633
|
- - ">="
|
data/cucumber/paperclip_steps.rb
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
When /^I attach an? "([^\"]*)" "([^\"]*)" file to an? "([^\"]*)" on S3$/ do |attachment, extension, model|
|
2
|
-
stub_paperclip_s3(model, attachment, extension)
|
3
|
-
attach_file attachment,
|
4
|
-
"features/support/paperclip/#{model.gsub(" ", "_").underscore}/#{attachment}.#{extension}"
|
5
|
-
end
|
6
|
-
|
data/gemfiles/4.1.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.1.0"
|
12
|
-
|
13
|
-
group :development, :test do
|
14
|
-
gem "mime-types", "~> 1.16"
|
15
|
-
gem "builder"
|
16
|
-
gem "rubocop", :require => false
|
17
|
-
end
|
18
|
-
|
19
|
-
gemspec :path => "../"
|
@@ -1,42 +0,0 @@
|
|
1
|
-
require "active_support/deprecation"
|
2
|
-
|
3
|
-
module Paperclip
|
4
|
-
class Deprecations
|
5
|
-
class << self
|
6
|
-
def check
|
7
|
-
warn_aws_sdk_v1 if aws_sdk_v1?
|
8
|
-
warn_outdated_rails if active_model_version < "4.2"
|
9
|
-
end
|
10
|
-
|
11
|
-
private
|
12
|
-
|
13
|
-
def active_model_version
|
14
|
-
::ActiveModel::VERSION::STRING
|
15
|
-
end
|
16
|
-
|
17
|
-
def aws_sdk_v1?
|
18
|
-
defined?(::AWS) && aws_sdk_version < "2"
|
19
|
-
end
|
20
|
-
|
21
|
-
def warn_aws_sdk_v1
|
22
|
-
warn "[paperclip] [deprecation] AWS SDK v1 has been deprecated in " \
|
23
|
-
"paperclip 5. Please consider upgrading to AWS 2 before " \
|
24
|
-
"upgrading paperclip."
|
25
|
-
end
|
26
|
-
|
27
|
-
def warn_outdated_rails
|
28
|
-
warn "[paperclip] [deprecation] Rails 3.2 and 4.1 are unsupported as " \
|
29
|
-
"of Rails 5 release. Please upgrade to Rails 4.2 before " \
|
30
|
-
"upgrading paperclip."
|
31
|
-
end
|
32
|
-
|
33
|
-
def aws_sdk_version
|
34
|
-
::AWS::VERSION
|
35
|
-
end
|
36
|
-
|
37
|
-
def warn(message)
|
38
|
-
ActiveSupport::Deprecation.warn(message)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
de:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "muss zwischen %{min} und %{max} sein"
|
5
|
-
spoofed_media_type: "trägt eine Dateiendung, die nicht mit dem Inhalt der Datei übereinstimmt"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
es:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "debe estar entre %{min} y %{max}"
|
5
|
-
spoofed_media_type: "tiene una extensión que no coincide con su contenido"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
ja:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "の容量は%{min}以上%{max}以下にしてください。"
|
5
|
-
spoofed_media_type: "の拡張子と内容が一致していません。"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
pt-BR:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "deve ter entre %{min} e %{max}"
|
5
|
-
spoofed_media_type: "tem uma extensão que não corresponde ao seu conteúdo"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
zh-CN:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "文件大小必须介于 %{min} 到 %{max} 之间"
|
5
|
-
spoofed_media_type: "扩展名与内容类型不符"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
zh-HK:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "必須介於%{min}到%{max}之間"
|
5
|
-
spoofed_media_type: "副檔名與內容類型不匹配"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
zh-TW:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "檔案大小必須介於 %{min} 到 %{max} 之間"
|
5
|
-
spoofed_media_type: "副檔名與內容類型不符"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,65 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "aws-sdk"
|
3
|
-
require "active_support/testing/deprecation"
|
4
|
-
|
5
|
-
describe Paperclip::Deprecations do
|
6
|
-
include ActiveSupport::Testing::Deprecation
|
7
|
-
|
8
|
-
describe ".check" do
|
9
|
-
before do
|
10
|
-
ActiveSupport::Deprecation.silenced = false
|
11
|
-
end
|
12
|
-
|
13
|
-
after do
|
14
|
-
ActiveSupport::Deprecation.silenced = true
|
15
|
-
end
|
16
|
-
|
17
|
-
context "when active model version is < 4.2" do
|
18
|
-
it "displays deprecation warning" do
|
19
|
-
Paperclip::Deprecations.stubs(:active_model_version).returns("4.1")
|
20
|
-
|
21
|
-
assert_deprecated("Rails 3.2 and 4.1 are unsupported") do
|
22
|
-
Paperclip::Deprecations.check
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
context "when active model version is 4.2" do
|
28
|
-
it "do not display deprecation warning" do
|
29
|
-
Paperclip::Deprecations.stubs(:active_model_version).returns("4.2")
|
30
|
-
|
31
|
-
assert_not_deprecated do
|
32
|
-
Paperclip::Deprecations.check
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
context "when aws sdk version is < 2" do
|
38
|
-
before do
|
39
|
-
::AWS.stub! if !defined?(::AWS)
|
40
|
-
end
|
41
|
-
|
42
|
-
it "displays deprecation warning" do
|
43
|
-
Paperclip::Deprecations.stubs(:aws_sdk_version).returns("1.68.0")
|
44
|
-
|
45
|
-
assert_deprecated("AWS SDK v1 has been deprecated") do
|
46
|
-
Paperclip::Deprecations.check
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
context "when aws sdk version is 2" do
|
52
|
-
before do
|
53
|
-
::AWS.stub! if !defined?(::AWS)
|
54
|
-
end
|
55
|
-
|
56
|
-
it "do not display deprecation warning" do
|
57
|
-
Paperclip::Deprecations.stubs(:aws_sdk_version).returns("2.0.0")
|
58
|
-
|
59
|
-
assert_not_deprecated do
|
60
|
-
Paperclip::Deprecations.check
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
RSpec.configure do |config|
|
2
|
-
config.before(:all) do
|
3
|
-
ActiveSupport::Deprecation.silenced = true
|
4
|
-
end
|
5
|
-
config.before(:each) do
|
6
|
-
Paperclip::Deprecations.stubs(:active_model_version).returns("4.2")
|
7
|
-
Paperclip::Deprecations.stubs(:aws_sdk_version).returns("2.0.0")
|
8
|
-
end
|
9
|
-
end
|