paperclip 3.5.4 → 4.3.7

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 (198) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -6
  3. data/.hound.yml +1066 -0
  4. data/.rubocop.yml +1 -0
  5. data/.travis.yml +11 -17
  6. data/Appraisals +6 -14
  7. data/CONTRIBUTING.md +13 -8
  8. data/Gemfile +16 -3
  9. data/LICENSE +1 -3
  10. data/NEWS +167 -49
  11. data/README.md +294 -75
  12. data/RELEASING.md +17 -0
  13. data/Rakefile +6 -8
  14. data/features/basic_integration.feature +24 -6
  15. data/features/step_definitions/attachment_steps.rb +30 -22
  16. data/features/step_definitions/html_steps.rb +2 -2
  17. data/features/step_definitions/rails_steps.rb +44 -14
  18. data/features/step_definitions/web_steps.rb +1 -103
  19. data/features/support/env.rb +2 -2
  20. data/features/support/file_helpers.rb +2 -2
  21. data/features/support/fixtures/gemfile.txt +1 -1
  22. data/features/support/rails.rb +2 -1
  23. data/gemfiles/3.2.gemfile +14 -6
  24. data/gemfiles/4.1.gemfile +19 -0
  25. data/gemfiles/4.2.gemfile +19 -0
  26. data/lib/generators/paperclip/paperclip_generator.rb +0 -2
  27. data/lib/generators/paperclip/templates/paperclip_migration.rb.erb +1 -1
  28. data/lib/paperclip/attachment.rb +132 -38
  29. data/lib/paperclip/attachment_registry.rb +1 -1
  30. data/lib/paperclip/callbacks.rb +11 -1
  31. data/lib/paperclip/content_type_detector.rb +25 -22
  32. data/lib/paperclip/deprecations.rb +42 -0
  33. data/lib/paperclip/errors.rb +5 -0
  34. data/lib/paperclip/file_command_content_type_detector.rb +6 -8
  35. data/lib/paperclip/geometry_detector_factory.rb +3 -1
  36. data/lib/paperclip/geometry_parser_factory.rb +1 -1
  37. data/lib/paperclip/has_attached_file.rb +10 -0
  38. data/lib/paperclip/interpolations/plural_cache.rb +6 -5
  39. data/lib/paperclip/interpolations.rb +25 -12
  40. data/lib/paperclip/io_adapters/abstract_adapter.rb +3 -1
  41. data/lib/paperclip/io_adapters/attachment_adapter.rb +4 -4
  42. data/lib/paperclip/io_adapters/data_uri_adapter.rb +5 -10
  43. data/lib/paperclip/io_adapters/stringio_adapter.rb +6 -10
  44. data/lib/paperclip/io_adapters/uri_adapter.rb +30 -11
  45. data/lib/paperclip/locales/de.yml +18 -0
  46. data/lib/paperclip/locales/en.yml +1 -0
  47. data/lib/paperclip/locales/es.yml +18 -0
  48. data/lib/paperclip/locales/ja.yml +18 -0
  49. data/lib/paperclip/locales/pt-BR.yml +18 -0
  50. data/lib/paperclip/locales/zh-CN.yml +18 -0
  51. data/lib/paperclip/locales/zh-HK.yml +18 -0
  52. data/lib/paperclip/locales/zh-TW.yml +18 -0
  53. data/lib/paperclip/matchers/have_attached_file_matcher.rb +2 -1
  54. data/lib/paperclip/matchers/validate_attachment_presence_matcher.rb +2 -1
  55. data/lib/paperclip/matchers/validate_attachment_size_matcher.rb +2 -1
  56. data/lib/paperclip/media_type_spoof_detector.rb +89 -0
  57. data/lib/paperclip/processor.rb +0 -37
  58. data/lib/paperclip/processor_helpers.rb +50 -0
  59. data/lib/paperclip/rails_environment.rb +25 -0
  60. data/lib/paperclip/schema.rb +10 -2
  61. data/lib/paperclip/storage/filesystem.rb +1 -1
  62. data/lib/paperclip/storage/fog.rb +18 -7
  63. data/lib/paperclip/storage/s3.rb +53 -22
  64. data/lib/paperclip/style.rb +8 -2
  65. data/lib/paperclip/tempfile_factory.rb +5 -1
  66. data/lib/paperclip/thumbnail.rb +12 -10
  67. data/lib/paperclip/url_generator.rb +11 -3
  68. data/lib/paperclip/validators/attachment_content_type_validator.rb +4 -0
  69. data/lib/paperclip/validators/attachment_file_name_validator.rb +80 -0
  70. data/lib/paperclip/validators/attachment_file_type_ignorance_validator.rb +29 -0
  71. data/lib/paperclip/validators/attachment_presence_validator.rb +4 -0
  72. data/lib/paperclip/validators/attachment_size_validator.rb +11 -3
  73. data/lib/paperclip/validators/media_type_spoof_detection_validator.rb +27 -0
  74. data/lib/paperclip/validators.rb +10 -3
  75. data/lib/paperclip/version.rb +1 -1
  76. data/lib/paperclip.rb +26 -8
  77. data/lib/tasks/paperclip.rake +17 -2
  78. data/paperclip.gemspec +16 -14
  79. data/shoulda_macros/paperclip.rb +0 -1
  80. data/spec/paperclip/attachment_definitions_spec.rb +13 -0
  81. data/{test/attachment_processing_test.rb → spec/paperclip/attachment_processing_spec.rb} +20 -21
  82. data/spec/paperclip/attachment_registry_spec.rb +130 -0
  83. data/{test/attachment_test.rb → spec/paperclip/attachment_spec.rb} +438 -397
  84. data/{test/content_type_detector_test.rb → spec/paperclip/content_type_detector_spec.rb} +16 -19
  85. data/spec/paperclip/deprecations_spec.rb +65 -0
  86. data/{test/file_command_content_type_detector_test.rb → spec/paperclip/file_command_content_type_detector_spec.rb} +5 -6
  87. data/spec/paperclip/filename_cleaner_spec.rb +14 -0
  88. data/spec/paperclip/geometry_detector_spec.rb +39 -0
  89. data/{test/geometry_parser_test.rb → spec/paperclip/geometry_parser_spec.rb} +27 -27
  90. data/{test/geometry_test.rb → spec/paperclip/geometry_spec.rb} +50 -52
  91. data/spec/paperclip/glue_spec.rb +44 -0
  92. data/{test/has_attached_file_test.rb → spec/paperclip/has_attached_file_spec.rb} +45 -28
  93. data/{test/integration_test.rb → spec/paperclip/integration_spec.rb} +134 -126
  94. data/{test/interpolations_test.rb → spec/paperclip/interpolations_spec.rb} +70 -46
  95. data/spec/paperclip/io_adapters/abstract_adapter_spec.rb +78 -0
  96. data/{test/io_adapters/attachment_adapter_test.rb → spec/paperclip/io_adapters/attachment_adapter_spec.rb} +27 -29
  97. data/{test/io_adapters/data_uri_adapter_test.rb → spec/paperclip/io_adapters/data_uri_adapter_spec.rb} +26 -17
  98. data/spec/paperclip/io_adapters/empty_string_adapter_spec.rb +17 -0
  99. data/{test/io_adapters/file_adapter_test.rb → spec/paperclip/io_adapters/file_adapter_spec.rb} +36 -40
  100. data/{test/io_adapters/http_url_proxy_adapter_test.rb → spec/paperclip/io_adapters/http_url_proxy_adapter_spec.rb} +31 -29
  101. data/spec/paperclip/io_adapters/identity_adapter_spec.rb +8 -0
  102. data/{test/io_adapters/nil_adapter_test.rb → spec/paperclip/io_adapters/nil_adapter_spec.rb} +7 -7
  103. data/{test/io_adapters/registry_test.rb → spec/paperclip/io_adapters/registry_spec.rb} +10 -7
  104. data/{test/io_adapters/stringio_adapter_test.rb → spec/paperclip/io_adapters/stringio_adapter_spec.rb} +20 -17
  105. data/{test/io_adapters/uploaded_file_adapter_test.rb → spec/paperclip/io_adapters/uploaded_file_adapter_spec.rb} +41 -41
  106. data/{test/io_adapters/uri_adapter_test.rb → spec/paperclip/io_adapters/uri_adapter_spec.rb} +53 -28
  107. data/spec/paperclip/matchers/have_attached_file_matcher_spec.rb +19 -0
  108. data/spec/paperclip/matchers/validate_attachment_content_type_matcher_spec.rb +99 -0
  109. data/spec/paperclip/matchers/validate_attachment_presence_matcher_spec.rb +69 -0
  110. data/spec/paperclip/matchers/validate_attachment_size_matcher_spec.rb +88 -0
  111. data/spec/paperclip/media_type_spoof_detector_spec.rb +79 -0
  112. data/spec/paperclip/meta_class_spec.rb +30 -0
  113. data/spec/paperclip/paperclip_missing_attachment_styles_spec.rb +84 -0
  114. data/{test/paperclip_test.rb → spec/paperclip/paperclip_spec.rb} +53 -48
  115. data/spec/paperclip/plural_cache_spec.rb +37 -0
  116. data/spec/paperclip/processor_helpers_spec.rb +57 -0
  117. data/{test/processor_test.rb → spec/paperclip/processor_spec.rb} +5 -5
  118. data/spec/paperclip/rails_environment_spec.rb +33 -0
  119. data/{test/rake_test.rb → spec/paperclip/rake_spec.rb} +15 -15
  120. data/spec/paperclip/schema_spec.rb +248 -0
  121. data/{test/storage/filesystem_test.rb → spec/paperclip/storage/filesystem_spec.rb} +18 -18
  122. data/spec/paperclip/storage/fog_spec.rb +535 -0
  123. data/spec/paperclip/storage/s3_live_spec.rb +182 -0
  124. data/spec/paperclip/storage/s3_spec.rb +1526 -0
  125. data/spec/paperclip/style_spec.rb +255 -0
  126. data/spec/paperclip/tempfile_factory_spec.rb +33 -0
  127. data/{test/thumbnail_test.rb → spec/paperclip/thumbnail_spec.rb} +123 -107
  128. data/spec/paperclip/url_generator_spec.rb +211 -0
  129. data/spec/paperclip/validators/attachment_content_type_validator_spec.rb +322 -0
  130. data/spec/paperclip/validators/attachment_file_name_validator_spec.rb +160 -0
  131. data/{test/validators/attachment_presence_validator_test.rb → spec/paperclip/validators/attachment_presence_validator_spec.rb} +20 -20
  132. data/{test/validators/attachment_size_validator_test.rb → spec/paperclip/validators/attachment_size_validator_spec.rb} +65 -58
  133. data/spec/paperclip/validators/media_type_spoof_detection_validator_spec.rb +52 -0
  134. data/spec/paperclip/validators_spec.rb +164 -0
  135. data/spec/spec_helper.rb +43 -0
  136. data/spec/support/assertions.rb +71 -0
  137. data/spec/support/deprecations.rb +9 -0
  138. data/spec/support/fake_model.rb +25 -0
  139. data/spec/support/fake_rails.rb +12 -0
  140. data/spec/support/fixtures/empty.html +1 -0
  141. data/spec/support/fixtures/empty.xlsx +0 -0
  142. data/spec/support/fixtures/spaced file.jpg +0 -0
  143. data/spec/support/matchers/accept.rb +5 -0
  144. data/spec/support/matchers/exist.rb +5 -0
  145. data/spec/support/matchers/have_column.rb +23 -0
  146. data/spec/support/model_reconstruction.rb +60 -0
  147. data/spec/support/rails_helpers.rb +7 -0
  148. data/spec/support/test_data.rb +13 -0
  149. data/spec/support/version_helper.rb +9 -0
  150. metadata +334 -219
  151. data/RUNNING_TESTS.md +0 -4
  152. data/gemfiles/3.0.gemfile +0 -11
  153. data/gemfiles/3.1.gemfile +0 -11
  154. data/gemfiles/4.0.gemfile +0 -11
  155. data/test/attachment_definitions_test.rb +0 -12
  156. data/test/attachment_registry_test.rb +0 -88
  157. data/test/filename_cleaner_test.rb +0 -14
  158. data/test/generator_test.rb +0 -84
  159. data/test/geometry_detector_test.rb +0 -24
  160. data/test/helper.rb +0 -232
  161. data/test/io_adapters/abstract_adapter_test.rb +0 -58
  162. data/test/io_adapters/empty_string_adapter_test.rb +0 -18
  163. data/test/io_adapters/identity_adapter_test.rb +0 -8
  164. data/test/matchers/have_attached_file_matcher_test.rb +0 -24
  165. data/test/matchers/validate_attachment_content_type_matcher_test.rb +0 -110
  166. data/test/matchers/validate_attachment_presence_matcher_test.rb +0 -69
  167. data/test/matchers/validate_attachment_size_matcher_test.rb +0 -86
  168. data/test/meta_class_test.rb +0 -32
  169. data/test/paperclip_missing_attachment_styles_test.rb +0 -90
  170. data/test/plural_cache_test.rb +0 -36
  171. data/test/schema_test.rb +0 -200
  172. data/test/storage/fog_test.rb +0 -473
  173. data/test/storage/s3_live_test.rb +0 -179
  174. data/test/storage/s3_test.rb +0 -1356
  175. data/test/style_test.rb +0 -213
  176. data/test/support/mock_model.rb +0 -2
  177. data/test/tempfile_factory_test.rb +0 -17
  178. data/test/url_generator_test.rb +0 -187
  179. data/test/validators/attachment_content_type_validator_test.rb +0 -324
  180. data/test/validators_test.rb +0 -61
  181. /data/{test → spec}/database.yml +0 -0
  182. /data/{test → spec/support}/fixtures/12k.png +0 -0
  183. /data/{test → spec/support}/fixtures/50x50.png +0 -0
  184. /data/{test → spec/support}/fixtures/5k.png +0 -0
  185. /data/{test → spec/support}/fixtures/animated +0 -0
  186. /data/{test → spec/support}/fixtures/animated.gif +0 -0
  187. /data/{test → spec/support}/fixtures/animated.unknown +0 -0
  188. /data/{test → spec/support}/fixtures/bad.png +0 -0
  189. /data/{test → spec/support}/fixtures/fog.yml +0 -0
  190. /data/{test → spec/support}/fixtures/rotated.jpg +0 -0
  191. /data/{test → spec/support}/fixtures/s3.yml +0 -0
  192. /data/{test → spec/support}/fixtures/spaced file.png +0 -0
  193. /data/{test → spec/support}/fixtures/text.txt +0 -0
  194. /data/{test → spec/support}/fixtures/twopage.pdf +0 -0
  195. /data/{test → spec/support}/fixtures/uppercase.PNG +0 -0
  196. /data/{test → spec}/support/mock_attachment.rb +0 -0
  197. /data/{test → spec}/support/mock_interpolator.rb +0 -0
  198. /data/{test → spec}/support/mock_url_generator_builder.rb +0 -0
data/.rubocop.yml ADDED
@@ -0,0 +1 @@
1
+ inherit_from: .hound.yml
data/.travis.yml CHANGED
@@ -1,28 +1,22 @@
1
1
  rvm:
2
- - 1.9.2
3
- - 1.9.3
2
+ - 2.0
3
+ - 2.1
4
+ - 2.2.2
4
5
  - jruby-19mode
5
- - rbx-19mode
6
- - 2.0.0
7
- - 2.1.0
6
+ - rbx-2
8
7
 
9
- install:
10
- - "bundle install"
11
-
12
- before_script: "sudo ntpdate -ub ntp.ubuntu.com pool.ntp.org; true"
13
- script: "bundle exec rake clean test cucumber"
8
+ script: "bundle exec rake clean spec cucumber"
14
9
 
15
10
  gemfile:
16
- - gemfiles/3.0.gemfile
17
- - gemfiles/3.1.gemfile
18
11
  - gemfiles/3.2.gemfile
19
- - gemfiles/4.0.gemfile
12
+ - gemfiles/4.1.gemfile
13
+ - gemfiles/4.2.gemfile
20
14
 
21
15
  matrix:
16
+ fast_finish: true
22
17
  allow_failures:
23
18
  - rvm: jruby-19mode
24
- - rvm: rbx-19mode
19
+ - rvm: rbx-2
25
20
 
26
- exclude:
27
- - rvm: 1.9.2
28
- gemfile: gemfiles/4.0.gemfile
21
+ sudo: false
22
+ cache: bundler
data/Appraisals CHANGED
@@ -1,19 +1,11 @@
1
- appraise "3.0" do
2
- gem "rails", "~> 3.0.20"
3
- gem "paperclip", :path => "../"
4
- end
5
-
6
- appraise "3.1" do
7
- gem "rails", "~> 3.1.12"
8
- gem "paperclip", :path => "../"
1
+ appraise "3.2" do
2
+ gem "rails", "~> 3.2.0"
9
3
  end
10
4
 
11
- appraise "3.2" do
12
- gem "rails", "~> 3.2.15"
13
- gem "paperclip", :path => "../"
5
+ appraise "4.1" do
6
+ gem "rails", "~> 4.1.0"
14
7
  end
15
8
 
16
- appraise "4.0" do
17
- gem "rails", "~> 4.0.0"
18
- gem "paperclip", :path => "../"
9
+ appraise "4.2" do
10
+ gem "rails", "~> 4.2.0"
19
11
  end
data/CONTRIBUTING.md CHANGED
@@ -6,7 +6,7 @@ We love pull requests. Here's a quick guide:
6
6
  1. Fork the repo.
7
7
 
8
8
  2. Run the tests. We only take pull requests with passing tests, and it's great
9
- to know that you have a clean slate: `bundle && rake`
9
+ to know that you have a clean slate: `bundle && bundle exec rake`
10
10
 
11
11
  3. Add a test for your change. Only refactoring and documentation changes
12
12
  require no new tests. If you are adding functionality or fixing a bug, we need
@@ -17,8 +17,9 @@ a test!
17
17
  5. Push to your fork and submit a pull request.
18
18
 
19
19
  At this point you're waiting on us. We like to at least comment on, if not
20
- accept, pull requests within three business days (and, typically, one business
21
- day). We may suggest some changes or improvements or alternatives.
20
+ accept, pull requests within seven business days (most of the work on Paperclip
21
+ gets done on Fridays). We may suggest some changes or improvements or
22
+ alternatives.
22
23
 
23
24
  Some things that will increase the chance that your pull request is accepted,
24
25
  taken straight from the Ruby on Rails guide:
@@ -35,27 +36,31 @@ Paperclip uses [Appraisal](https://github.com/thoughtbot/appraisal) to aid
35
36
  testing against multiple version of Ruby on Rails. This helps us to make sure
36
37
  that Paperclip performs correctly with them.
37
38
 
39
+ Paperclip also uses [RSpec](http://rspec.info) for its unit tests. If you submit
40
+ tests that are not written for Cucumber or RSpec without a very good reason, you
41
+ will be asked to rewrite them before we'll accept.
42
+
38
43
  ### Bootstrapping your test suite:
39
44
 
40
45
  bundle install
41
- bundle exec rake appraisal:install
46
+ bundle exec appraisal install
42
47
 
43
48
  This will install all the required gems that requires to test against each
44
49
  version of Rails, which defined in `gemfiles/*.gemfile`.
45
50
 
46
51
  ### To run a full test suite:
47
52
 
48
- bundle exec rake
53
+ bundle exec appraisal rake
49
54
 
50
- This will run Test::Unit and Cucumber against all version of Rails
55
+ This will run RSpec and Cucumber against all version of Rails
51
56
 
52
57
  ### To run single Test::Unit or Cucumber test
53
58
 
54
59
  You need to specify a `BUNDLE_GEMFILE` pointing to the gemfile before running
55
60
  the normal test command:
56
61
 
57
- BUNDLE_GEMFILE=gemfiles/3.2.gemfile ruby -Itest test/schema_test.rb
58
- BUNDLE_GEMFILE=gemfiles/3.2.gemfile cucumber features/basic_integration.feature
62
+ BUNDLE_GEMFILE=gemfiles/4.1.gemfile rspec spec/paperclip/attachment_spec.rb
63
+ BUNDLE_GEMFILE=gemfiles/4.1.gemfile cucumber features/basic_integration.feature
59
64
 
60
65
  Syntax
61
66
  ------
data/Gemfile CHANGED
@@ -2,7 +2,20 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'jruby-openssl', :platform => :jruby
6
- gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
5
+ gem 'sqlite3', '~> 1.3.8', :platforms => :ruby
7
6
 
8
- gem 'pry', :platform => :ruby
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
+ gem 'pry'
14
+
15
+ # Hinting at development dependencies
16
+ # Prevents bundler from taking a long-time to resolve
17
+ group :development, :test do
18
+ gem 'mime-types', '~> 1.16'
19
+ gem 'builder'
20
+ gem 'rubocop', require: false
21
+ end
data/LICENSE CHANGED
@@ -3,7 +3,7 @@ LICENSE
3
3
 
4
4
  The MIT License
5
5
 
6
- Copyright (c) 2008-2013 Jon Yurek and thoughtbot, inc.
6
+ Copyright (c) 2008-2015 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
@@ -22,5 +22,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
22
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
23
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
24
  THE SOFTWARE.
25
-
26
-
data/NEWS CHANGED
@@ -1,37 +1,155 @@
1
- New in 3.5.4:
2
-
3
- Bug Fix: Users were reporting IOErrors. Stop closing extra files to prevent.
4
-
5
- New in 3.5.3:
6
-
7
- Improvement: After three long, hard years... we know how to upgrade
8
- Bug Fix: #expiring_url returns 'missing' urls if nothing is attached
9
- Improvement: Lots of documentation fixes
10
- Improvement: Lots of fixes for Ruby warnings
11
- Improvement: Test the most appropriate Ruby/Rails comobinations on Travis
12
- Improvement: Delegate more IO methods through IOAdapters
13
- Improvement: Remove Rails 4 deprecations
14
- Improvement: Both S3's and Fog's #expiring_url can take a Time or Int
15
- Bug Fix: Both S3's and Fog's expiring_url respect style when missing the file
16
- Bug Fix: Timefiles will have a reasonable-length name. They're all MD5 hashes now
17
- Bug Fix: Don't delete files off S3 when reprocessing due to AWS inconsistencies
18
- Bug Fix: "swallow_stream" isn't thread dafe. Use :swallow_stderr
19
- Improvement: Regexps use \A and \Z instead of ^ and $
20
- Improvement: :s3_credentials can take a lambda as an argument
21
- Improvement: Search up the class heirarchy for attachments
22
- Improvement: deep_merge options instead of regular merge
23
- Bug Fix: Prevent file deletion on transaction rollback
24
- Test Improvement: Ensure more files are properly closed during tests
25
- Test Bug Fix: Return the gemfile's syntax to normal
26
-
27
- New in 3.5.2:
1
+ 4.3.7 (7/1/2016):
2
+
3
+ * Add deprecation warnings
4
+ * Improvement: Add `fog_options` configuration to send options to fog when storing files.
5
+ * Improvement: the `URI adapter` now uses the content-disposition header to name the downloaded file.
6
+
7
+ 4.3.6 (3/13/2016):
8
+
9
+ * Bug Fix: When a spoofed media type is detected, megabytes of mime-types info are added to logs. See https://cwe.mitre.org/data/definitions/779.html.
10
+
11
+ 4.3.5 (2/8/2016):
12
+
13
+ * Bug Fix: Remove deprecation warnings for v5.0 for now. Will re-add once the version has landed.
14
+
15
+ 4.3.4 (2/2/2016):
16
+
17
+ * Bug Fix: Fix incompatible change from v4.3.3.
18
+
19
+ 4.3.3 (1/29/2016):
20
+
21
+ * Improvement: Add deprecation warnings in preparation for release of v5.0
22
+
23
+ 4.3.2 (11/18/2015):
24
+
25
+ * Performance: Reduce memory allocations (#2056)
26
+
27
+ 4.3.1 (9/9/2015):
28
+
29
+ * Backport of bugfix to `remove_column`, so it works in Rails 3 and 4
30
+ c740fb171fe2f88c60b999d2a1c2122f2b8f43e9
31
+ * Fix GeometryParser regex for usage of '@>' flag
32
+ * `url` on a unpersisted record returns default_url
33
+ * spec deprecation warnings and failures
34
+ * README adjustments
35
+
36
+ 4.3.0 (6/18/2015):
37
+
38
+ * Improvement: Update aws-sdk and cucumber gem versions.
39
+ * Improvement: Add `length` alias for `size` method in AbstractAdapter.
40
+ * Improvement: Removed some cruft
41
+ * Improvement: deep_merge! Attachment definitions
42
+ * Improvement: Switch to mimemagic gem for content-type detection
43
+ * Improvement: Allows multiple content types for spoof detector
44
+ * Bug Fix: Don't assume we have Rails.env if we have Rails
45
+ * Performance: Decrease Memory footprint
46
+ * Ruby Versioning: Drop support for 1.9.3 (EOL'ed)
47
+ * Rails Versioning: Drop support for 4.0.0 (EOL'ed)
48
+
49
+ 4.2.4:
50
+
51
+ * Rollback backwards incompatible change, allowing paperclip to run on
52
+ Ruby >= 1.9.2.
53
+
54
+ 4.2.3:
55
+
56
+ * Fix dependency specifications (didn't work with Rails 4.1)
57
+ * Fix paperclip tests in CI
58
+
59
+ 4.2.2:
60
+
61
+ * Security fix: Fix a potential security issue with spoofing
62
+
63
+ 4.2.1:
64
+
65
+ * Improvement: Added `validate_media_type` options to allow/bypass spoof check
66
+ * Improvement: Added incremental backoff when AWS gives us a SlowDown error.
67
+ * Improvement: Stream downloads when usign aws-sdk.
68
+ * Improvement: Documentation fixes, includes Windows instructions.
69
+ * Improvement: Added pt-BR, zh-HK, zh-CN, zh-TW, and ja-JP locales.
70
+ * Improvement: Better escaping for characters in URLs
71
+ * Improvement: Honor `fog_credentials[:scheme]`
72
+ * Improvement: Also look for custom processors in lib/paperclip
73
+ * Improvement: id partitioning for string IDs works like integer id
74
+ * Improvement: Can pass options to DB adapters in migrations
75
+ * Improvement: Update expiring_url creation for later versions of fog
76
+ * Improvement: `path` can be a Proc in S3 attachments
77
+ * Test Fix: Improves speed and reliability of the specs
78
+ * Bug Fix: #original_filename= does not error when passed `nil`
79
+
80
+ 4.2.0:
81
+
82
+ * Improvement: Converted test suite from test/unit to RSpec
83
+ * Improvement: Refactored Paperclip::Attachment#assign
84
+ * Improvement: Added Spanish and German locales
85
+ * Improvement: Required Validators accept validator subclasses
86
+ * Improvement: EXIF orientation checking can be turned off for performance
87
+ * Improvement: Documentation updates
88
+ * Improvement: Better #human_size method for AttachmentSizeValidators
89
+ * Bug Fix: Allow MIME-types with dots in them
90
+ * Improvement: Travis CI updates
91
+ * Improvement: Validators can take multiple messages
92
+ * Improvement: Per-style options for S3 storage
93
+ * Improvement: Allow `nil` geometry strings
94
+ * Improvement: Use `eager_load!`
95
+
96
+ 4.1.1:
97
+
98
+ * Improvement: Add default translations for spoof validation
99
+ * Bug Fix: Don't check for spoofs if the file hasn't changed
100
+ * Bug Fix: Callback chain terminator is different in Rails 4.1, remove warnings
101
+ * Improvement: Fixed various Ruby warnings
102
+ * Bug Fix: Give bundler a hint, so it doesn't run forever on a fresh bundle
103
+ * Improvement: Documentation fixes
104
+ * Improvement: Allow travis-ci to finish-fast
105
+
106
+
107
+ 4.1.0:
108
+
109
+ * Improvement: Add :content_type_mappings to correct for missing spoof types
110
+ * Improvement: Credit Egor Homakov with discovering the content_type spoof bug
111
+ * Improvement: Memoize calls to identify in the thumbnail processor
112
+ * Improvement: Make MIME type optional for Data URIs.
113
+ * Improvement: Add default format for styles
114
+
115
+ 4.0.0:
116
+
117
+ * Security: Attachments are checked to make sure they're not pulling a fast one.
118
+ * Security: It is now *enforced* that every attachment has a file/mime validation.
119
+ * Bug Fix: Removed a call to IOAdapter#close that was causing issues.
120
+ * Improvement: Added bullets to the 3.5.3 list of changes. Very important.
121
+ * Improvement: Updated the copyright to 2014
122
+
123
+ 3.5.3:
124
+
125
+ * Improvement: After three long, hard years... we know how to upgrade
126
+ * Bug Fix: #expiring_url returns 'missing' urls if nothing is attached
127
+ * Improvement: Lots of documentation fixes
128
+ * Improvement: Lots of fixes for Ruby warnings
129
+ * Improvement: Test the most appropriate Ruby/Rails comobinations on Travis
130
+ * Improvement: Delegate more IO methods through IOAdapters
131
+ * Improvement: Remove Rails 4 deprecations
132
+ * Improvement: Both S3's and Fog's #expiring_url can take a Time or Int
133
+ * Bug Fix: Both S3's and Fog's expiring_url respect style when missing the file
134
+ * Bug Fix: Timefiles will have a reasonable-length name. They're all MD5 hashes now
135
+ * Bug Fix: Don't delete files off S3 when reprocessing due to AWS inconsistencies
136
+ * Bug Fix: "swallow_stream" isn't thread dafe. Use :swallow_stderr
137
+ * Improvement: Regexps use \A and \Z instead of ^ and $
138
+ * Improvement: :s3_credentials can take a lambda as an argument
139
+ * Improvement: Search up the class heirarchy for attachments
140
+ * Improvement: deep_merge options instead of regular merge
141
+ * Bug Fix: Prevent file deletion on transaction rollback
142
+ * Test Improvement: Ensure more files are properly closed during tests
143
+ * Test Bug Fix: Return the gemfile's syntax to normal
144
+
145
+ 3.5.2:
28
146
 
29
147
  * Security: Force cocaine to at least 0.5.3 to include a security fix
30
148
  * Improvement: Fixed some README exmaples
31
149
  * Feature: Added HTTP URL Proxy Adapter, can assign string URLs as attachments
32
150
  * Improvement: Put validation errors on the base attribute and the sub-attribute
33
151
 
34
- New in 3.5.1:
152
+ 3.5.1:
35
153
 
36
154
  * Bug Fix: Returned the class-level `attachment_definitions` method for compatability.
37
155
  * Improvement: Ensured compatability with Rails 4
@@ -39,7 +157,7 @@ New in 3.5.1:
39
157
  * Bug Fix: #1296, where validations were generating errors
40
158
  * Improvement: Specify MIT license in the gemspec
41
159
 
42
- New in 3.5.0:
160
+ 3.5.0:
43
161
 
44
162
  * Feature: Handle Base64-encoded data URIs as uploads
45
163
  * Feature: Add a FilenameCleaner class to allow custom filename sanitation
@@ -55,7 +173,7 @@ New in 3.5.0:
55
173
  * Improvement: Added Ruby 2.0.0 as a supported platform and removed 1.8.7
56
174
  * Improvement: Fixed some incompatabilities in the test suite
57
175
 
58
- New in 3.4.2:
176
+ 3.4.2:
59
177
 
60
178
  * Improvement: Use https for Gemfile urls
61
179
  * Improvement: Updated and more correct documentation
@@ -65,7 +183,7 @@ New in 3.4.2:
65
183
  * Improvement: Remove path clash checking, as it's unnecessary
66
184
  * Bug Fix: Do not rely on checking version numbers for aws-sdk
67
185
 
68
- New in 3.4.1:
186
+ 3.4.1:
69
187
 
70
188
  * Improvement: Various documentation fixes and improvements
71
189
  * Bug Fix: Clearing an attachment with `preserve_files` on should still clear the attachment
@@ -78,7 +196,7 @@ New in 3.4.1:
78
196
  * Improvement: Update to latest cocaine
79
197
  * Improvement: Update copyrights, various typos
80
198
 
81
- New in 3.4.0:
199
+ 3.4.0:
82
200
 
83
201
  * Bug Fix: Allow UploadedFileAdapter to force the use of `file`
84
202
  * Bug Fix: Close the file handle when dealing with URIs
@@ -108,11 +226,11 @@ New In 3.3.1:
108
226
 
109
227
  * Bug Fix: Moved Filesystem's copy_to_local_file to the right place.
110
228
 
111
- New in 3.3.0:
229
+ 3.3.0:
112
230
 
113
231
  * Improvement: Upgrade cocaine to 0.4
114
232
 
115
- New in 3.2.0:
233
+ 3.2.0:
116
234
 
117
235
  * Bug Fix: Use the new correct Amazon S3 encryption header.
118
236
  * Bug Fix: The rake task respects the updated_at column.
@@ -121,14 +239,14 @@ New in 3.2.0:
121
239
  * Feature: Automatically rotate images.
122
240
  * Feature: Reduce class-oriented programming of the attachment definitions.
123
241
 
124
- New in 3.1.4:
242
+ 3.1.4:
125
243
 
126
244
  * Bug Fix: Allow user to be able to set path without `:style` attribute and not raising an error.
127
245
  This is a regression introduced in 3.1.3, and that feature will be postponed to another minor
128
246
  release instead.
129
247
  * Feature: Allow for URI Adapter as an optional paperclip io adapter.
130
248
 
131
- New in 3.1.3:
249
+ 3.1.3:
132
250
 
133
251
  * Bug Fix: Copy empty attachment between instances is now working.
134
252
  * Bug Fix: Correctly rescue Fog error.
@@ -140,17 +258,17 @@ New in 3.1.3:
140
258
  * Bug Fix: Paperclip now gracefully handles msising file command.
141
259
  * Bug Fix: `StringIOAdapter` now accepts content type.
142
260
 
143
- New in 3.1.2:
261
+ 3.1.2:
144
262
 
145
263
  * Bug Fix: #remove_attachment on 3.1.0 and 3.1.1 mistakenly trying to remove the column that has
146
264
  the same name as data type (such as :string, :datetime, :interger.) You're advised to update to
147
265
  Paperclip 3.1.2 as soon as possible.
148
266
 
149
- New in 3.1.1:
267
+ 3.1.1:
150
268
 
151
269
  * Bug Fix: Paperclip will only load Paperclip::Schema only when Active Record is available.
152
270
 
153
- New in 3.1.0:
271
+ 3.1.0:
154
272
 
155
273
  * Feature: Paperclip now support new migration syntax (sexy migration) that reads better:
156
274
 
@@ -189,11 +307,11 @@ New in 3.1.0:
189
307
  the best_content_type to throw an error on trying nil.content_type.
190
308
  * Bug Fix: Fix problem when the gem cannot be installed on the system that has Asepsis installed.
191
309
 
192
- New in 3.0.4:
310
+ 3.0.4:
193
311
 
194
312
  * Feature: Adds support for S3 scheme-less URL generation.
195
313
 
196
- New in 3.0.3:
314
+ 3.0.3:
197
315
 
198
316
  * Bug Fix: ThumbnailProcessor now correctly detects and preserve animated GIF.
199
317
  * Bug Fix: File extension is now preserved in generated Tempfile from adapter.
@@ -216,7 +334,7 @@ New in 3.0.3:
216
334
  * Bug Fix: Fix attachment.reprocess! when using storage providers fog and s3.
217
335
  * Bug Fix: Fix a problem with incorrect content_type detected with 'file' command for an empty file on Mac.
218
336
 
219
- New in 3.0.2:
337
+ 3.0.2:
220
338
 
221
339
  * API CHANGE: Generated migration class name is now plural (AddAttachmentToUsers instead of AddAttachmentToUser)
222
340
  * API CHANGE: Remove Rails plugin initialization code.
@@ -225,13 +343,13 @@ New in 3.0.2:
225
343
  * Bug Fix: Fix a problem when there's no logger specified.
226
344
  * Bug Fix: Fix a problem when attaching Rack::Test::UploadedFile instance.
227
345
 
228
- New in 3.0.1:
346
+ 3.0.1:
229
347
 
230
348
  * Feature: Introduce Paperlip IO adapter.
231
349
  * Bug Fix: Regression in AttachmentContentTypeValidator has been fixed.
232
350
  * API CHANGE: #to_file has been removed. Use the #copy_to_local_file method instead.
233
351
 
234
- New in 3.0.0:
352
+ 3.0.0:
235
353
 
236
354
  * API CHANGE: Paperclip now requires at least Ruby on Rails version 3.0.0
237
355
  * API CHANGE: The default :url and :path have changed. The new scheme avoids
@@ -250,7 +368,7 @@ New in 3.0.0:
250
368
  * Bug Fix: File given to S3 and Fog storage will now be rewinded after flush_write.
251
369
  * Feature: You can now pass addional parameter to S3 expiring URL, such as :content_type.
252
370
 
253
- New in 2.7.0:
371
+ 2.7.0:
254
372
 
255
373
  * Bug Fix: Checking the existence of a file on S3 handles all AWS errors.
256
374
  * Bug Fix: Clear the fingerprint when removing an attachment.
@@ -259,25 +377,25 @@ New in 2.7.0:
259
377
  * Compatibility: Support for ActiveSupport < 2.3.12.
260
378
  * Compatibility: Support for Rails 3.2.
261
379
 
262
- New in 2.6.0:
380
+ 2.6.0:
263
381
 
264
382
  * Bug Fix: Files are re-wound after reading.
265
383
  * Feature: Remove Rails dependency from specs that need Paperclip.
266
384
  * Feature: Validation matchers support conditionals.
267
385
 
268
- New in 2.5.2:
386
+ 2.5.2:
269
387
 
270
388
  * Bug Fix: Can be installed on Windows.
271
389
  * Feature: The Fog bucket name, authentication, and host can be determined at runtime via Proc.
272
390
  * Feature: Special characters are replaced with underscores in #url and #path.
273
391
 
274
- New in 2.5.1:
392
+ 2.5.1:
275
393
 
276
394
  * Feature: After we've computed the content type, pass it to Fog.
277
395
  * Feature: S3 encryption with the new :s3_server_side_encryption option.
278
396
  * Feature: Works without ActiveRecord, allowing for e.g. mongo backends.
279
397
 
280
- New in 2.5.0:
398
+ 2.5.0:
281
399
 
282
400
  * Performance: Only connect to S3 when absolutely needed.
283
401
  * Bug Fix: STI with cached classes respect new options.