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.
- checksums.yaml +4 -4
- data/.travis.yml +13 -9
- data/Appraisals +22 -6
- data/CONTRIBUTING.md +6 -1
- data/Gemfile +2 -8
- data/LICENSE +1 -1
- data/NEWS +28 -37
- data/README.md +81 -63
- data/UPGRADING +9 -9
- data/features/basic_integration.feature +1 -0
- data/features/step_definitions/s3_steps.rb +6 -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} +7 -1
- data/lib/paperclip.rb +0 -2
- data/lib/paperclip/attachment.rb +9 -8
- data/lib/paperclip/attachment_registry.rb +2 -1
- data/lib/paperclip/callbacks.rb +8 -6
- data/lib/paperclip/glue.rb +1 -1
- data/lib/paperclip/has_attached_file.rb +7 -1
- data/lib/paperclip/io_adapters/uri_adapter.rb +11 -30
- data/lib/paperclip/schema.rb +1 -2
- data/lib/paperclip/storage/s3.rb +59 -35
- data/lib/paperclip/version.rb +1 -1
- data/paperclip.gemspec +11 -7
- data/spec/paperclip/attachment_registry_spec.rb +28 -0
- data/spec/paperclip/attachment_spec.rb +32 -6
- 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 +5 -8
- data/spec/paperclip/io_adapters/uri_adapter_spec.rb +6 -31
- data/spec/paperclip/media_type_spoof_detector_spec.rb +3 -12
- data/spec/paperclip/paperclip_spec.rb +0 -32
- data/spec/paperclip/storage/s3_live_spec.rb +8 -4
- data/spec/paperclip/storage/s3_spec.rb +345 -165
- data/spec/paperclip/validators_spec.rb +2 -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 +45 -40
- 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
|
-
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
|