paperclip 4.3.0 → 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 +14 -13
- data/Appraisals +22 -9
- data/CONTRIBUTING.md +16 -5
- data/Gemfile +2 -8
- data/LICENSE +1 -1
- data/NEWS +49 -2
- data/README.md +126 -102
- data/UPGRADING +12 -9
- data/features/basic_integration.feature +1 -0
- data/features/migration.feature +0 -24
- data/features/step_definitions/attachment_steps.rb +20 -20
- 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.2.gemfile → 4.2.awsv2.gemfile} +1 -1
- data/gemfiles/5.0.awsv2.0.gemfile +17 -0
- data/gemfiles/5.0.awsv2.1.gemfile +17 -0
- data/gemfiles/{4.1.gemfile → 5.0.awsv2.gemfile} +2 -2
- data/lib/paperclip/attachment.rb +18 -17
- 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/geometry_parser_factory.rb +1 -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/interpolations/plural_cache.rb +6 -5
- data/lib/paperclip/interpolations.rb +18 -13
- 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 +1 -1
- data/lib/paperclip/rails_environment.rb +1 -1
- data/lib/paperclip/schema.rb +3 -9
- data/lib/paperclip/storage/fog.rb +17 -8
- data/lib/paperclip/storage/s3.rb +51 -49
- data/lib/paperclip/validators/attachment_size_validator.rb +1 -7
- data/lib/paperclip/version.rb +3 -1
- data/lib/paperclip.rb +2 -1
- data/lib/tasks/paperclip.rake +1 -1
- data/paperclip.gemspec +15 -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 +36 -14
- 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 +14 -4
- data/spec/paperclip/io_adapters/http_url_proxy_adapter_spec.rb +12 -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 +12 -3
- data/spec/paperclip/paperclip_spec.rb +3 -28
- data/spec/paperclip/plural_cache_spec.rb +17 -16
- data/spec/paperclip/storage/fog_spec.rb +31 -1
- 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 +6 -1
- data/spec/support/assertions.rb +7 -0
- data/spec/support/model_reconstruction.rb +9 -1
- data/spec/support/reporting.rb +11 -0
- metadata +74 -47
- data/cucumber/paperclip_steps.rb +0 -6
- data/gemfiles/3.2.gemfile +0 -20
- 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/rails_helpers.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4787def2cfada09ed3791a17a356d403c289df8a
|
4
|
+
data.tar.gz: fa4e3a08de8f08483299905ea9ed65e9246bcf9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c34f90ee3cce719d4915eab1703bb0825584e2361230402bc705e6d5ac0e98e5cc5dc524380d5bed415c38e208604156223f3315044b76ef98b11ddd8cb1817
|
7
|
+
data.tar.gz: b1b9a56925bb9d9c35725a500f241deab6631c9b1142815dfd1d93104a99de12aa74ae68f4a415599fb3f966ce1b189577e977a1c2d24d521b5f35e592cc76ae
|
data/.travis.yml
CHANGED
@@ -1,25 +1,26 @@
|
|
1
1
|
rvm:
|
2
|
-
-
|
3
|
-
- rbx-2
|
4
|
-
- 2.0.0
|
5
|
-
- 2.1.1
|
2
|
+
- 2.1
|
6
3
|
- 2.2.2
|
7
4
|
|
8
|
-
install:
|
9
|
-
- "travis_retry bundle install"
|
10
|
-
|
11
5
|
script: "bundle exec rake clean spec cucumber"
|
12
6
|
|
13
7
|
gemfile:
|
14
|
-
- gemfiles/
|
15
|
-
- gemfiles/4.1.gemfile
|
16
|
-
- gemfiles/
|
8
|
+
- gemfiles/4.2.awsv2.0.gemfile
|
9
|
+
- gemfiles/4.2.awsv2.1.gemfile
|
10
|
+
- gemfiles/5.0.awsv2.0.gemfile
|
11
|
+
- gemfiles/5.0.awsv2.1.gemfile
|
17
12
|
|
18
13
|
matrix:
|
19
14
|
fast_finish: true
|
20
|
-
|
21
|
-
-
|
22
|
-
|
15
|
+
exclude:
|
16
|
+
- gemfile: gemfiles/5.0.awsv2.0.gemfile
|
17
|
+
rvm: 2.0
|
18
|
+
- gemfile: gemfiles/5.0.awsv2.1.gemfile
|
19
|
+
rvm: 2.0
|
20
|
+
- gemfile: gemfiles/5.0.awsv2.0.gemfile
|
21
|
+
rvm: 2.1
|
22
|
+
- gemfile: gemfiles/5.0.awsv2.1.gemfile
|
23
|
+
rvm: 2.1
|
23
24
|
|
24
25
|
sudo: false
|
25
26
|
cache: bundler
|
data/Appraisals
CHANGED
@@ -1,14 +1,27 @@
|
|
1
|
-
appraise "
|
2
|
-
gem "rails", "~>
|
3
|
-
gem "
|
1
|
+
appraise "4.2.awsv2.0" do
|
2
|
+
gem "rails", "~> 4.2.0"
|
3
|
+
gem "aws-sdk", "~> 2.0.0"
|
4
4
|
end
|
5
5
|
|
6
|
-
appraise "4.1" do
|
7
|
-
gem "rails", "~> 4.
|
8
|
-
gem "
|
6
|
+
appraise "4.2.awsv2.1" do
|
7
|
+
gem "rails", "~> 4.2.0"
|
8
|
+
gem "aws-sdk", "~> 2.1.0"
|
9
|
+
|
10
|
+
group :development, :test do
|
11
|
+
gem 'mime-types', '>= 1.16', '< 4'
|
12
|
+
end
|
9
13
|
end
|
10
14
|
|
11
|
-
appraise "
|
12
|
-
gem "rails", "
|
13
|
-
gem "
|
15
|
+
appraise "5.0.awsv2.0" do
|
16
|
+
gem "rails", "5.0.0.beta3"
|
17
|
+
gem "aws-sdk", "~> 2.0.0"
|
18
|
+
|
19
|
+
group :development, :test do
|
20
|
+
gem 'mime-types', '>= 1.16', '< 4'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
appraise "5.0.awsv2.1" do
|
25
|
+
gem "rails", "5.0.0.beta3"
|
26
|
+
gem "aws-sdk", "~> 2.1.0"
|
14
27
|
end
|
data/CONTRIBUTING.md
CHANGED
@@ -1,20 +1,31 @@
|
|
1
1
|
Contributing
|
2
2
|
============
|
3
3
|
|
4
|
-
We love pull requests.
|
4
|
+
We love pull requests from everyone. By participating in this project, you agree
|
5
|
+
to abide by the thoughtbot [code of conduct].
|
6
|
+
|
7
|
+
[code of conduct]: https://thoughtbot.com/open-source-code-of-conduct
|
8
|
+
|
9
|
+
Here's a quick guide for contributing:
|
5
10
|
|
6
11
|
1. Fork the repo.
|
7
12
|
|
8
|
-
|
13
|
+
1. Make sure you have ImageMagick and Ghostscript installed. See [this section]
|
14
|
+
(./README.md#image-processor) of the README.
|
15
|
+
|
16
|
+
1. Run the tests. We only take pull requests with passing tests, and it's great
|
9
17
|
to know that you have a clean slate: `bundle && bundle exec rake`
|
10
18
|
|
11
|
-
|
19
|
+
1. Add a test for your change. Only refactoring and documentation changes
|
12
20
|
require no new tests. If you are adding functionality or fixing a bug, we need
|
13
21
|
a test!
|
14
22
|
|
15
|
-
|
23
|
+
1. Make the test pass.
|
24
|
+
|
25
|
+
1. Mention how your changes affect the project to other developers and users in
|
26
|
+
the `NEWS.md` file.
|
16
27
|
|
17
|
-
|
28
|
+
1. Push to your fork and submit a pull request.
|
18
29
|
|
19
30
|
At this point you're waiting on us. We like to at least comment on, if not
|
20
31
|
accept, pull requests within seven business days (most of the work on Paperclip
|
data/Gemfile
CHANGED
@@ -3,19 +3,13 @@ source "https://rubygems.org"
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
gem 'sqlite3', '~> 1.3.8', :platforms => :ruby
|
6
|
-
|
7
|
-
gem 'jruby-openssl', :platforms => :jruby
|
8
|
-
gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
|
9
|
-
|
10
|
-
gem 'rubysl', :platforms => :rbx
|
11
|
-
gem 'racc', :platforms => :rbx
|
12
|
-
|
13
6
|
gem 'pry'
|
14
7
|
|
15
8
|
# Hinting at development dependencies
|
16
9
|
# Prevents bundler from taking a long-time to resolve
|
17
10
|
group :development, :test do
|
18
|
-
gem '
|
11
|
+
gem 'activerecord-import'
|
12
|
+
gem 'mime-types'
|
19
13
|
gem 'builder'
|
20
14
|
gem 'rubocop', require: false
|
21
15
|
end
|
data/LICENSE
CHANGED
@@ -3,7 +3,7 @@ LICENSE
|
|
3
3
|
|
4
4
|
The MIT License
|
5
5
|
|
6
|
-
Copyright (c) 2008-
|
6
|
+
Copyright (c) 2008-2016 Jon Yurek and thoughtbot, inc.
|
7
7
|
|
8
8
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
9
|
of this software and associated documentation files (the "Software"), to deal
|
data/NEWS
CHANGED
@@ -1,4 +1,51 @@
|
|
1
|
-
|
1
|
+
master:
|
2
|
+
|
3
|
+
5.0.0 (2016-07-01):
|
4
|
+
|
5
|
+
* Improvement: Add `read_timeout` configuration for URI Adapter download_content method.
|
6
|
+
* README adjustments for Ruby beginners (add links, elucidate model in Quick Start)
|
7
|
+
* Bugfix: Now it's possible to save images from URLs with special characters [#1932]
|
8
|
+
* Bugfix: Return false when file to copy is not present in cloud storage [#2173]
|
9
|
+
* Automatically close file while checking mime type [#2016]
|
10
|
+
* Add `read_timeout` option to `UriAdapter#download_content` method [#2232]
|
11
|
+
* Fix a nil error in content type validation matcher [#1910]
|
12
|
+
* Documentation improvements
|
13
|
+
|
14
|
+
5.0.0.beta2 (2016-04-01):
|
15
|
+
|
16
|
+
* Bugfix: Dynamic fog directory option is now respected
|
17
|
+
* Bugfix: Fixes cocaine duplicated paths [#2169]
|
18
|
+
* Removal of dead code (older versions of Rails and AWS SDK)
|
19
|
+
* README adjustments
|
20
|
+
|
21
|
+
5.0.0.beta1 (2016-03-13):
|
22
|
+
|
23
|
+
* Bug Fix: megabytes of mime-types info in logs when a spoofed media type is detected.
|
24
|
+
* Drop support to end-of-life'd ruby 2.0.
|
25
|
+
* Drop support for end-of-life'd Rails 3.2 and 4.1
|
26
|
+
* Drop support for AWS v1
|
27
|
+
* Remove tests for JRuby and Rubinius from Travis CI (they were failing)
|
28
|
+
* Improvement: Add `fog_options` configuration to send options to fog when
|
29
|
+
storing files.
|
30
|
+
* Extracted repository for locales only: https://github.com/thoughtbot/paperclip-i18n
|
31
|
+
* Bugfix: Original file could be unlinked during `post_process_style`, producing failures
|
32
|
+
* Bugfix for image magick scaling images up
|
33
|
+
* Memory consumption improvements
|
34
|
+
* `url` on a unpersisted record returns `default_url` rather than `nil`
|
35
|
+
* Improvement: aws-sdk v2 support
|
36
|
+
https://github.com/thoughtbot/paperclip/pull/1903
|
37
|
+
|
38
|
+
If your Gemfile contains aws-sdk (>= 2.0.0) and aws-sdk-v1, paperclip will use
|
39
|
+
aws-sdk v2. With aws-sdk v2, S3 storage requires you to set the s3_region.
|
40
|
+
s3_region may be nested in s3_credentials, and (if not nested in
|
41
|
+
s3_credentials) it may be a Proc.
|
42
|
+
|
43
|
+
4.3
|
44
|
+
|
45
|
+
See patch versions in v4.3 NEWS:
|
46
|
+
https://github.com/thoughtbot/paperclip/blob/v4.3/NEWS
|
47
|
+
|
48
|
+
4.3.0 (2015-06-18):
|
2
49
|
|
3
50
|
* Improvement: Update aws-sdk and cucumber gem versions.
|
4
51
|
* Improvement: Add `length` alias for `size` method in AbstractAdapter.
|
@@ -11,7 +58,7 @@
|
|
11
58
|
* Ruby Versioning: Drop support for 1.9.3 (EOL'ed)
|
12
59
|
* Rails Versioning: Drop support for 4.0.0 (EOL'ed)
|
13
60
|
|
14
|
-
4.2.4:
|
61
|
+
4.2.4 (2015-06-05):
|
15
62
|
|
16
63
|
* Rollback backwards incompatible change, allowing paperclip to run on
|
17
64
|
Ruby >= 1.9.2.
|