paperclip 4.2.2 → 5.0.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 +18 -15
- data/Appraisals +20 -12
- data/CONTRIBUTING.md +19 -8
- data/Gemfile +4 -9
- data/LICENSE +1 -1
- data/NEWS +101 -31
- data/README.md +243 -159
- data/RELEASING.md +17 -0
- data/Rakefile +1 -1
- data/UPGRADING +12 -9
- data/features/basic_integration.feature +8 -4
- data/features/migration.feature +0 -24
- data/features/step_definitions/attachment_steps.rb +27 -21
- data/features/step_definitions/html_steps.rb +2 -2
- data/features/step_definitions/rails_steps.rb +11 -17
- data/features/step_definitions/s3_steps.rb +2 -2
- data/features/step_definitions/web_steps.rb +1 -103
- data/features/support/file_helpers.rb +2 -2
- data/gemfiles/4.2.awsv2.0.gemfile +17 -0
- data/gemfiles/4.2.awsv2.1.gemfile +17 -0
- data/gemfiles/{4.1.gemfile → 4.2.awsv2.gemfile} +4 -3
- data/gemfiles/5.0.awsv2.0.gemfile +17 -0
- data/gemfiles/5.0.awsv2.1.gemfile +17 -0
- data/gemfiles/{4.2.gemfile → 5.0.awsv2.gemfile} +4 -3
- data/lib/paperclip/attachment.rb +19 -16
- data/lib/paperclip/attachment_registry.rb +3 -2
- data/lib/paperclip/callbacks.rb +8 -6
- data/lib/paperclip/content_type_detector.rb +27 -11
- data/lib/paperclip/errors.rb +3 -1
- data/lib/paperclip/file_command_content_type_detector.rb +6 -8
- data/lib/paperclip/geometry_parser_factory.rb +1 -1
- data/lib/paperclip/glue.rb +1 -1
- data/lib/paperclip/has_attached_file.rb +9 -2
- data/lib/paperclip/helpers.rb +14 -10
- data/lib/paperclip/interpolations/plural_cache.rb +6 -5
- data/lib/paperclip/interpolations.rb +18 -13
- data/lib/paperclip/io_adapters/abstract_adapter.rb +1 -0
- data/lib/paperclip/io_adapters/http_url_proxy_adapter.rb +1 -1
- data/lib/paperclip/io_adapters/uri_adapter.rb +3 -1
- data/lib/paperclip/matchers/validate_attachment_content_type_matcher.rb +4 -4
- data/lib/paperclip/media_type_spoof_detector.rb +2 -2
- data/lib/paperclip/rails_environment.rb +25 -0
- data/lib/paperclip/schema.rb +3 -9
- data/lib/paperclip/storage/fog.rb +21 -12
- data/lib/paperclip/storage/s3.rb +51 -50
- data/lib/paperclip/thumbnail.rb +2 -3
- data/lib/paperclip/validators/attachment_size_validator.rb +1 -7
- data/lib/paperclip/version.rb +3 -1
- data/lib/paperclip.rb +15 -4
- data/lib/tasks/paperclip.rake +17 -1
- data/paperclip.gemspec +18 -15
- data/spec/paperclip/attachment_definitions_spec.rb +1 -1
- data/spec/paperclip/attachment_processing_spec.rb +2 -4
- data/spec/paperclip/attachment_registry_spec.rb +84 -13
- data/spec/paperclip/attachment_spec.rb +91 -31
- 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/geometry_spec.rb +1 -1
- data/spec/paperclip/glue_spec.rb +44 -0
- data/spec/paperclip/has_attached_file_spec.rb +24 -8
- data/spec/paperclip/integration_spec.rb +4 -3
- data/spec/paperclip/interpolations_spec.rb +16 -13
- 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/http_url_proxy_adapter_spec.rb +12 -0
- data/spec/paperclip/io_adapters/stringio_adapter_spec.rb +4 -0
- data/spec/paperclip/io_adapters/uri_adapter_spec.rb +27 -0
- data/spec/paperclip/matchers/validate_attachment_content_type_matcher_spec.rb +10 -0
- data/spec/paperclip/media_type_spoof_detector_spec.rb +34 -11
- data/spec/paperclip/paperclip_spec.rb +4 -29
- data/spec/paperclip/plural_cache_spec.rb +17 -16
- data/spec/paperclip/rails_environment_spec.rb +33 -0
- data/spec/paperclip/storage/fog_spec.rb +42 -3
- data/spec/paperclip/storage/s3_live_spec.rb +8 -4
- data/spec/paperclip/storage/s3_spec.rb +255 -180
- 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/attachment_size_validator_spec.rb +26 -20
- data/spec/paperclip/validators_spec.rb +3 -3
- data/spec/spec_helper.rb +6 -1
- data/spec/support/assertions.rb +7 -0
- 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
- data/spec/support/model_reconstruction.rb +9 -1
- data/spec/support/reporting.rb +11 -0
- metadata +105 -54
- data/RUNNING_TESTS.md +0 -4
- data/cucumber/paperclip_steps.rb +0 -6
- data/gemfiles/3.2.gemfile +0 -19
- data/gemfiles/4.0.gemfile +0 -19
- 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/support/mock_model.rb +0 -2
- data/spec/support/rails_helpers.rb +0 -7
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/3.2.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", "~> 3.2.15"
|
|
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/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 => "../"
|
|
@@ -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"
|
data/spec/support/mock_model.rb
DELETED