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.

Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +14 -13
  3. data/Appraisals +22 -9
  4. data/CONTRIBUTING.md +16 -5
  5. data/Gemfile +2 -8
  6. data/LICENSE +1 -1
  7. data/NEWS +49 -2
  8. data/README.md +126 -102
  9. data/UPGRADING +12 -9
  10. data/features/basic_integration.feature +1 -0
  11. data/features/migration.feature +0 -24
  12. data/features/step_definitions/attachment_steps.rb +20 -20
  13. data/features/step_definitions/html_steps.rb +2 -2
  14. data/features/step_definitions/rails_steps.rb +11 -17
  15. data/features/step_definitions/s3_steps.rb +2 -2
  16. data/features/step_definitions/web_steps.rb +1 -103
  17. data/features/support/file_helpers.rb +2 -2
  18. data/gemfiles/4.2.awsv2.0.gemfile +17 -0
  19. data/gemfiles/4.2.awsv2.1.gemfile +17 -0
  20. data/gemfiles/{4.2.gemfile → 4.2.awsv2.gemfile} +1 -1
  21. data/gemfiles/5.0.awsv2.0.gemfile +17 -0
  22. data/gemfiles/5.0.awsv2.1.gemfile +17 -0
  23. data/gemfiles/{4.1.gemfile → 5.0.awsv2.gemfile} +2 -2
  24. data/lib/paperclip/attachment.rb +18 -17
  25. data/lib/paperclip/attachment_registry.rb +2 -1
  26. data/lib/paperclip/callbacks.rb +8 -6
  27. data/lib/paperclip/content_type_detector.rb +3 -2
  28. data/lib/paperclip/errors.rb +3 -1
  29. data/lib/paperclip/geometry_parser_factory.rb +1 -1
  30. data/lib/paperclip/glue.rb +1 -1
  31. data/lib/paperclip/has_attached_file.rb +7 -1
  32. data/lib/paperclip/helpers.rb +14 -10
  33. data/lib/paperclip/interpolations/plural_cache.rb +6 -5
  34. data/lib/paperclip/interpolations.rb +18 -13
  35. data/lib/paperclip/io_adapters/http_url_proxy_adapter.rb +1 -1
  36. data/lib/paperclip/io_adapters/uri_adapter.rb +3 -1
  37. data/lib/paperclip/matchers/validate_attachment_content_type_matcher.rb +4 -4
  38. data/lib/paperclip/media_type_spoof_detector.rb +1 -1
  39. data/lib/paperclip/rails_environment.rb +1 -1
  40. data/lib/paperclip/schema.rb +3 -9
  41. data/lib/paperclip/storage/fog.rb +17 -8
  42. data/lib/paperclip/storage/s3.rb +51 -49
  43. data/lib/paperclip/validators/attachment_size_validator.rb +1 -7
  44. data/lib/paperclip/version.rb +3 -1
  45. data/lib/paperclip.rb +2 -1
  46. data/lib/tasks/paperclip.rake +1 -1
  47. data/paperclip.gemspec +15 -11
  48. data/spec/paperclip/attachment_processing_spec.rb +2 -4
  49. data/spec/paperclip/attachment_registry_spec.rb +28 -0
  50. data/spec/paperclip/attachment_spec.rb +36 -14
  51. data/spec/paperclip/geometry_spec.rb +1 -1
  52. data/spec/paperclip/glue_spec.rb +44 -0
  53. data/spec/paperclip/has_attached_file_spec.rb +24 -8
  54. data/spec/paperclip/integration_spec.rb +4 -3
  55. data/spec/paperclip/interpolations_spec.rb +14 -4
  56. data/spec/paperclip/io_adapters/http_url_proxy_adapter_spec.rb +12 -0
  57. data/spec/paperclip/io_adapters/uri_adapter_spec.rb +27 -0
  58. data/spec/paperclip/matchers/validate_attachment_content_type_matcher_spec.rb +10 -0
  59. data/spec/paperclip/media_type_spoof_detector_spec.rb +12 -3
  60. data/spec/paperclip/paperclip_spec.rb +3 -28
  61. data/spec/paperclip/plural_cache_spec.rb +17 -16
  62. data/spec/paperclip/storage/fog_spec.rb +31 -1
  63. data/spec/paperclip/storage/s3_live_spec.rb +8 -4
  64. data/spec/paperclip/storage/s3_spec.rb +213 -156
  65. data/spec/paperclip/validators/attachment_size_validator_spec.rb +26 -20
  66. data/spec/paperclip/validators_spec.rb +3 -3
  67. data/spec/spec_helper.rb +6 -1
  68. data/spec/support/assertions.rb +7 -0
  69. data/spec/support/model_reconstruction.rb +9 -1
  70. data/spec/support/reporting.rb +11 -0
  71. metadata +74 -47
  72. data/cucumber/paperclip_steps.rb +0 -6
  73. data/gemfiles/3.2.gemfile +0 -20
  74. data/lib/paperclip/locales/de.yml +0 -18
  75. data/lib/paperclip/locales/es.yml +0 -18
  76. data/lib/paperclip/locales/ja.yml +0 -18
  77. data/lib/paperclip/locales/pt-BR.yml +0 -18
  78. data/lib/paperclip/locales/zh-CN.yml +0 -18
  79. data/lib/paperclip/locales/zh-HK.yml +0 -18
  80. data/lib/paperclip/locales/zh-TW.yml +0 -18
  81. data/spec/support/rails_helpers.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7376a7a60b80472f8d87f7fbe9e1e136bbcd6faa
4
- data.tar.gz: 18a9883b6f09d1cdd00ca7129fc5ddce4093ae48
3
+ metadata.gz: 4787def2cfada09ed3791a17a356d403c289df8a
4
+ data.tar.gz: fa4e3a08de8f08483299905ea9ed65e9246bcf9f
5
5
  SHA512:
6
- metadata.gz: d3c793e25734f74e0663e40932fce40f4c5912b4ae25ada5035982535acc67eb7944ff1916fb3e8b9f2615b7ffe10a08f5523ef5330400c42de07b9dbcddf883
7
- data.tar.gz: c7b753c7d728374e31c59239dbe3c61ea98be06056b9b910a4b70e872d2c0531a0c61b54910f7384983f3fb5d86aaaf28add6317bcc84b5c776a8e0281adb50d
6
+ metadata.gz: 6c34f90ee3cce719d4915eab1703bb0825584e2361230402bc705e6d5ac0e98e5cc5dc524380d5bed415c38e208604156223f3315044b76ef98b11ddd8cb1817
7
+ data.tar.gz: b1b9a56925bb9d9c35725a500f241deab6631c9b1142815dfd1d93104a99de12aa74ae68f4a415599fb3f966ce1b189577e977a1c2d24d521b5f35e592cc76ae
data/.travis.yml CHANGED
@@ -1,25 +1,26 @@
1
1
  rvm:
2
- - jruby-19mode
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/3.2.gemfile
15
- - gemfiles/4.1.gemfile
16
- - gemfiles/4.2.gemfile
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
- allow_failures:
21
- - rvm: jruby-19mode
22
- - rvm: rbx-2
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 "3.2" do
2
- gem "rails", "~> 3.2.0"
3
- gem "paperclip", :path => "../"
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.1.0"
8
- gem "paperclip", :path => "../"
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 "4.2" do
12
- gem "rails", "~> 4.2.0"
13
- gem "paperclip", :path => "../"
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. Here's a quick guide:
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
- 2. Run the tests. We only take pull requests with passing tests, and it's great
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
- 3. Add a test for your change. Only refactoring and documentation changes
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
- 4. Make the test pass.
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
- 5. Push to your fork and submit a pull request.
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 'mime-types', '~> 1.16'
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-2015 Jon Yurek and thoughtbot, inc.
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
- 4.3.0:
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.