paperclip 4.3.7 → 5.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of paperclip might be problematic. Click here for more details.

Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +13 -9
  3. data/Appraisals +22 -6
  4. data/CONTRIBUTING.md +6 -1
  5. data/Gemfile +2 -8
  6. data/LICENSE +1 -1
  7. data/NEWS +28 -37
  8. data/README.md +81 -63
  9. data/UPGRADING +9 -9
  10. data/features/basic_integration.feature +1 -0
  11. data/features/step_definitions/s3_steps.rb +6 -2
  12. data/gemfiles/{4.1.gemfile → 4.2.awsv2.0.gemfile} +4 -6
  13. data/gemfiles/4.2.awsv2.1.gemfile +17 -0
  14. data/gemfiles/{4.2.gemfile → 4.2.awsv2.gemfile} +1 -0
  15. data/gemfiles/5.0.awsv2.0.gemfile +17 -0
  16. data/gemfiles/5.0.awsv2.1.gemfile +17 -0
  17. data/gemfiles/{3.2.gemfile → 5.0.awsv2.gemfile} +7 -1
  18. data/lib/paperclip.rb +0 -2
  19. data/lib/paperclip/attachment.rb +9 -8
  20. data/lib/paperclip/attachment_registry.rb +2 -1
  21. data/lib/paperclip/callbacks.rb +8 -6
  22. data/lib/paperclip/glue.rb +1 -1
  23. data/lib/paperclip/has_attached_file.rb +7 -1
  24. data/lib/paperclip/io_adapters/uri_adapter.rb +11 -30
  25. data/lib/paperclip/schema.rb +1 -2
  26. data/lib/paperclip/storage/s3.rb +59 -35
  27. data/lib/paperclip/version.rb +1 -1
  28. data/paperclip.gemspec +11 -7
  29. data/spec/paperclip/attachment_registry_spec.rb +28 -0
  30. data/spec/paperclip/attachment_spec.rb +32 -6
  31. data/spec/paperclip/has_attached_file_spec.rb +24 -8
  32. data/spec/paperclip/integration_spec.rb +4 -3
  33. data/spec/paperclip/io_adapters/http_url_proxy_adapter_spec.rb +5 -8
  34. data/spec/paperclip/io_adapters/uri_adapter_spec.rb +6 -31
  35. data/spec/paperclip/media_type_spoof_detector_spec.rb +3 -12
  36. data/spec/paperclip/paperclip_spec.rb +0 -32
  37. data/spec/paperclip/storage/s3_live_spec.rb +8 -4
  38. data/spec/paperclip/storage/s3_spec.rb +345 -165
  39. data/spec/paperclip/validators_spec.rb +2 -3
  40. data/spec/spec_helper.rb +3 -1
  41. data/spec/support/assertions.rb +7 -0
  42. data/spec/support/model_reconstruction.rb +9 -1
  43. data/spec/support/reporting.rb +11 -0
  44. metadata +45 -40
  45. data/lib/paperclip/deprecations.rb +0 -42
  46. data/lib/paperclip/locales/de.yml +0 -18
  47. data/lib/paperclip/locales/es.yml +0 -18
  48. data/lib/paperclip/locales/ja.yml +0 -18
  49. data/lib/paperclip/locales/pt-BR.yml +0 -18
  50. data/lib/paperclip/locales/zh-CN.yml +0 -18
  51. data/lib/paperclip/locales/zh-HK.yml +0 -18
  52. data/lib/paperclip/locales/zh-TW.yml +0 -18
  53. data/spec/paperclip/deprecations_spec.rb +0 -65
  54. data/spec/support/deprecations.rb +0 -9
  55. data/spec/support/rails_helpers.rb +0 -7
@@ -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
@@ -1,7 +0,0 @@
1
- module RailsHelpers
2
- module ClassMethods
3
- def using_protected_attributes?
4
- ActiveRecord::VERSION::MAJOR < 4
5
- end
6
- end
7
- end