paperclip 4.3.7 → 5.0.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +13 -9
- data/Appraisals +22 -6
- data/CONTRIBUTING.md +16 -5
- data/Gemfile +2 -8
- data/LICENSE +1 -1
- data/NEWS +39 -27
- data/README.md +123 -101
- data/UPGRADING +12 -9
- data/features/basic_integration.feature +1 -0
- data/features/migration.feature +0 -24
- data/features/step_definitions/rails_steps.rb +0 -6
- data/features/step_definitions/s3_steps.rb +2 -2
- data/gemfiles/{4.1.gemfile → 4.2.awsv2.0.gemfile} +4 -6
- data/gemfiles/4.2.awsv2.1.gemfile +17 -0
- data/gemfiles/{4.2.gemfile → 4.2.awsv2.gemfile} +1 -0
- data/gemfiles/5.0.awsv2.0.gemfile +17 -0
- data/gemfiles/5.0.awsv2.1.gemfile +17 -0
- data/gemfiles/{3.2.gemfile → 5.0.awsv2.gemfile} +2 -1
- data/lib/paperclip.rb +2 -3
- data/lib/paperclip/attachment.rb +12 -10
- 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/glue.rb +1 -1
- data/lib/paperclip/has_attached_file.rb +7 -1
- data/lib/paperclip/helpers.rb +14 -10
- data/lib/paperclip/io_adapters/http_url_proxy_adapter.rb +1 -1
- data/lib/paperclip/io_adapters/uri_adapter.rb +12 -29
- data/lib/paperclip/matchers/validate_attachment_content_type_matcher.rb +4 -4
- data/lib/paperclip/schema.rb +2 -8
- data/lib/paperclip/storage/fog.rb +9 -6
- data/lib/paperclip/storage/s3.rb +42 -40
- data/lib/paperclip/validators/attachment_size_validator.rb +1 -7
- data/lib/paperclip/version.rb +3 -1
- data/lib/tasks/paperclip.rake +1 -1
- data/paperclip.gemspec +11 -8
- data/spec/paperclip/attachment_processing_spec.rb +2 -4
- data/spec/paperclip/attachment_registry_spec.rb +28 -0
- data/spec/paperclip/attachment_spec.rb +33 -10
- data/spec/paperclip/has_attached_file_spec.rb +24 -8
- data/spec/paperclip/integration_spec.rb +4 -3
- data/spec/paperclip/io_adapters/http_url_proxy_adapter_spec.rb +17 -8
- data/spec/paperclip/io_adapters/uri_adapter_spec.rb +32 -30
- data/spec/paperclip/matchers/validate_attachment_content_type_matcher_spec.rb +10 -0
- data/spec/paperclip/paperclip_spec.rb +3 -33
- data/spec/paperclip/storage/fog_spec.rb +10 -0
- data/spec/paperclip/storage/s3_live_spec.rb +8 -4
- data/spec/paperclip/storage/s3_spec.rb +213 -156
- data/spec/paperclip/validators/attachment_size_validator_spec.rb +26 -20
- data/spec/paperclip/validators_spec.rb +3 -3
- data/spec/spec_helper.rb +3 -1
- data/spec/support/assertions.rb +7 -0
- data/spec/support/model_reconstruction.rb +9 -1
- data/spec/support/reporting.rb +11 -0
- metadata +44 -37
- data/cucumber/paperclip_steps.rb +0 -6
- 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
@@ -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
|