jr-paperclip 8.0.3 → 8.0.4

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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/NEWS +6 -0
  3. data/Rakefile +2 -0
  4. data/lib/generators/paperclip/paperclip_generator.rb +2 -0
  5. data/lib/jr-paperclip.rb +2 -0
  6. data/lib/paperclip/attachment.rb +2 -0
  7. data/lib/paperclip/attachment_registry.rb +2 -0
  8. data/lib/paperclip/callbacks.rb +2 -0
  9. data/lib/paperclip/content_type_detector.rb +2 -0
  10. data/lib/paperclip/errors.rb +2 -0
  11. data/lib/paperclip/file_command_content_type_detector.rb +2 -0
  12. data/lib/paperclip/filename_cleaner.rb +2 -0
  13. data/lib/paperclip/geometry.rb +3 -1
  14. data/lib/paperclip/geometry_detector_factory.rb +2 -0
  15. data/lib/paperclip/geometry_parser_factory.rb +2 -0
  16. data/lib/paperclip/glue.rb +2 -0
  17. data/lib/paperclip/has_attached_file.rb +2 -0
  18. data/lib/paperclip/helpers.rb +2 -0
  19. data/lib/paperclip/interpolations/plural_cache.rb +2 -0
  20. data/lib/paperclip/interpolations.rb +2 -0
  21. data/lib/paperclip/io_adapters/abstract_adapter.rb +2 -0
  22. data/lib/paperclip/io_adapters/attachment_adapter.rb +2 -0
  23. data/lib/paperclip/io_adapters/data_uri_adapter.rb +2 -0
  24. data/lib/paperclip/io_adapters/empty_string_adapter.rb +2 -0
  25. data/lib/paperclip/io_adapters/file_adapter.rb +2 -0
  26. data/lib/paperclip/io_adapters/http_url_proxy_adapter.rb +2 -0
  27. data/lib/paperclip/io_adapters/identity_adapter.rb +2 -0
  28. data/lib/paperclip/io_adapters/nil_adapter.rb +2 -0
  29. data/lib/paperclip/io_adapters/registry.rb +2 -0
  30. data/lib/paperclip/io_adapters/stringio_adapter.rb +2 -0
  31. data/lib/paperclip/io_adapters/uploaded_file_adapter.rb +2 -0
  32. data/lib/paperclip/io_adapters/uri_adapter.rb +2 -0
  33. data/lib/paperclip/logger.rb +2 -0
  34. data/lib/paperclip/matchers/have_attached_file_matcher.rb +2 -0
  35. data/lib/paperclip/matchers/validate_attachment_content_type_matcher.rb +5 -3
  36. data/lib/paperclip/matchers/validate_attachment_presence_matcher.rb +2 -0
  37. data/lib/paperclip/matchers/validate_attachment_size_matcher.rb +2 -0
  38. data/lib/paperclip/matchers.rb +2 -0
  39. data/lib/paperclip/media_type_spoof_detector.rb +2 -0
  40. data/lib/paperclip/missing_attachment_styles.rb +2 -0
  41. data/lib/paperclip/processor.rb +2 -0
  42. data/lib/paperclip/processor_helpers.rb +2 -0
  43. data/lib/paperclip/rails_environment.rb +2 -0
  44. data/lib/paperclip/railtie.rb +2 -0
  45. data/lib/paperclip/schema.rb +2 -0
  46. data/lib/paperclip/storage/filesystem.rb +2 -0
  47. data/lib/paperclip/storage/fog.rb +3 -2
  48. data/lib/paperclip/storage/s3.rb +3 -2
  49. data/lib/paperclip/storage.rb +2 -0
  50. data/lib/paperclip/style.rb +2 -0
  51. data/lib/paperclip/tempfile.rb +2 -0
  52. data/lib/paperclip/tempfile_factory.rb +2 -0
  53. data/lib/paperclip/thumbnail.rb +2 -0
  54. data/lib/paperclip/url_generator.rb +2 -0
  55. data/lib/paperclip/validators/attachment_content_type_validator.rb +2 -0
  56. data/lib/paperclip/validators/attachment_file_name_validator.rb +2 -0
  57. data/lib/paperclip/validators/attachment_file_type_ignorance_validator.rb +2 -0
  58. data/lib/paperclip/validators/attachment_presence_validator.rb +2 -0
  59. data/lib/paperclip/validators/attachment_size_validator.rb +2 -0
  60. data/lib/paperclip/validators/media_type_spoof_detection_validator.rb +2 -0
  61. data/lib/paperclip/validators.rb +2 -0
  62. data/lib/paperclip/version.rb +3 -1
  63. data/lib/paperclip.rb +2 -0
  64. data/lib/tasks/paperclip.rake +2 -0
  65. data/shoulda_macros/paperclip.rb +2 -0
  66. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33e2d6c7454262f7f7dbd9f3f90e9f3a02d7ac8322dce12d2207fbb49394d47c
4
- data.tar.gz: 3e5a22977575ff03ab26f09df063b2bad92d8dd615bf398aaa01eb626427188b
3
+ metadata.gz: 9b2623772668074ed1759914f0ae6f8fc2cbce60a4e9938d8b3f29c4c2bfa39b
4
+ data.tar.gz: 87a30e5c39dbdf9287cdca2004b4b59f93c86b03ed33dedafdf82356e5efbcf8
5
5
  SHA512:
6
- metadata.gz: defdf5784f3c2325a2b3b9c7748e30070ec2612a6d506d0c0b79c836eee1f851e5c35c61e44fead22572e11d444ea681ef9048c4efb6842d6b77feafb293deef
7
- data.tar.gz: f74bf5b90c340259a3fc521913b943245c8802ba650dbff107ef77379c45ebb6ce558f0f83aec0a56e577a6f06d5e9755429204f12140afe6b5e55583c559294
6
+ metadata.gz: 1ce9bd64c1e5e03ce3204e048d61dcd9f4bb64b5175c273dbbf65e93deedc8c81eee67183027b48af3e6a24076c1ecf63b070de5977c2ef664dca2d46e1e4419
7
+ data.tar.gz: 1b58ae63ba200cdac3ac918cc7f37ae86724a0740013d6ea8b013abe29ff35bc77941f91da41bbc90c9fa5134ddd76e20b0e7077f878556f9d30c879c8996ac3
data/NEWS CHANGED
@@ -1,3 +1,7 @@
1
+ 8.0.4 (2026-05-08)
2
+
3
+ * Improvement: Add frozen string literal comments and update mutable string builders for frozen string compatibility.
4
+
1
5
  8.0.3 (2026-01-20)
2
6
 
3
7
  * Improvement: Reduce gem package size by excluding non-runtime files
@@ -44,6 +48,8 @@
44
48
  * Stability: Update RuboCop configuration for latest version
45
49
  * Bugfix: Remove BOM character from locale file
46
50
 
51
+ * Improvement: Support aws-sdk-s3 >= 1.196.1 and multipart file downloads
52
+
47
53
  7.2.1 (2023-09-09)
48
54
  * Improvement: Support file extension names both as symbols and strings for :content_type_mappings
49
55
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "appraisal"
3
5
  require "rspec/core/rake_task"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "rails/generators/active_record"
2
4
 
3
5
  class PaperclipGenerator < ActiveRecord::Generators::Base
data/lib/jr-paperclip.rb CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "paperclip"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "uri"
2
4
  require "paperclip/url_generator"
3
5
  require "active_support/deprecation"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "singleton"
2
4
 
3
5
  module Paperclip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module Callbacks
3
5
  def self.included(base)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class ContentTypeDetector
3
5
  # The content-type detection strategy is as follows:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  # A base error class for Paperclip. Most of the error that will be thrown
3
5
  # from Paperclip will inherits from this class.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class FileCommandContentTypeDetector
3
5
  SENSIBLE_DEFAULT = "application/octet-stream"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class FilenameCleaner
3
5
  def initialize(invalid_character_regex)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  # Defines the geometry of an image.
3
5
  class Geometry
@@ -72,7 +74,7 @@ module Paperclip
72
74
 
73
75
  # Returns the width and height in a format suitable to be passed to Geometry.parse
74
76
  def to_s
75
- s = String.new
77
+ s = +""
76
78
  s << width.to_i.to_s if width > 0
77
79
  s << "x#{height.to_i}" if height > 0
78
80
  s << modifier.to_s
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class GeometryDetector
3
5
  def initialize(file, backend: nil)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class GeometryParser
3
5
  FORMAT = /\b(\d*)x?(\d*)\b(?:,(\d?))?(\@\>|\>\@|[\>\<\#\@\%^!])?/i.freeze
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "paperclip/callbacks"
2
4
  require "paperclip/validators"
3
5
  require "paperclip/schema"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class HasAttachedFile
3
5
  def self.define_on(klass, name, options)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module Helpers
3
5
  def configure
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module Interpolations
3
5
  class PluralCache
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  # This module contains all the methods that are available for interpolation
3
5
  # in paths and urls. To add your own (or override an existing one), you
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_support/core_ext/module/delegation"
2
4
 
3
5
  module Paperclip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class AttachmentAdapter < AbstractAdapter
3
5
  def self.register
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class DataUriAdapter < StringioAdapter
3
5
  def self.register
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class EmptyStringAdapter < AbstractAdapter
3
5
  def self.register
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class FileAdapter < AbstractAdapter
3
5
  def self.register
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class HttpUrlProxyAdapter < UriAdapter
3
5
  def self.register
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class IdentityAdapter < AbstractAdapter
3
5
  def self.register
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class NilAdapter < AbstractAdapter
3
5
  def self.register
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class AdapterRegistry
3
5
  class NoHandlerError < Paperclip::Error; end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class StringioAdapter < AbstractAdapter
3
5
  def self.register
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class UploadedFileAdapter < AbstractAdapter
3
5
  def self.register
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "open-uri"
2
4
 
3
5
  module Paperclip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module Logger
3
5
  # Log a paperclip-specific line. This will log to STDOUT
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module Shoulda
3
5
  module Matchers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module Shoulda
3
5
  module Matchers
@@ -39,7 +41,7 @@ module Paperclip
39
41
  end
40
42
 
41
43
  def failure_message
42
- "#{expected_attachment}\n".tap do |message|
44
+ (+"#{expected_attachment}\n").tap do |message|
43
45
  message << accepted_types_and_failures.to_s
44
46
  message << "\n\n" if @allowed_types.present? && @rejected_types.present?
45
47
  message << rejected_types_and_failures.to_s
@@ -54,7 +56,7 @@ module Paperclip
54
56
 
55
57
  def accepted_types_and_failures
56
58
  if @allowed_types.present?
57
- "Accept content types: #{@allowed_types.join(', ')}\n".tap do |message|
59
+ (+"Accept content types: #{@allowed_types.join(', ')}\n").tap do |message|
58
60
  message << if @missing_allowed_types.present?
59
61
  " #{@missing_allowed_types.join(', ')} were rejected."
60
62
  else
@@ -66,7 +68,7 @@ module Paperclip
66
68
 
67
69
  def rejected_types_and_failures
68
70
  if @rejected_types.present?
69
- "Reject content types: #{@rejected_types.join(', ')}\n".tap do |message|
71
+ (+"Reject content types: #{@rejected_types.join(', ')}\n").tap do |message|
70
72
  message << if @missing_rejected_types.present?
71
73
  " #{@missing_rejected_types.join(', ')} were accepted."
72
74
  else
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module Shoulda
3
5
  module Matchers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module Shoulda
3
5
  module Matchers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "paperclip/matchers/have_attached_file_matcher"
2
4
  require "paperclip/matchers/validate_attachment_presence_matcher"
3
5
  require "paperclip/matchers/validate_attachment_content_type_matcher"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class MediaTypeSpoofDetector
3
5
  def self.using(file, name, content_type)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "paperclip/attachment_registry"
2
4
  require "set"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  # Paperclip processors allow you to modify attached files when they are
3
5
  # attached in any way you are able. Paperclip itself uses command-line
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module ProcessorHelpers
3
5
  class NoSuchProcessor < StandardError; end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class RailsEnvironment
3
5
  def self.get
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "paperclip"
2
4
  require "paperclip/schema"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_support/deprecation"
2
4
 
3
5
  module Paperclip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module Storage
3
5
  # The default place to store attachments is in the filesystem. Files on the local
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module Storage
3
5
  # fog is a modern and versatile cloud computing library for Ruby.
@@ -44,8 +46,7 @@ module Paperclip
44
46
  begin
45
47
  require "fog"
46
48
  rescue LoadError => e
47
- e.message << " (You may need to install the fog gem)"
48
- raise e
49
+ raise("#{e.message} (You may need to install the fog gem)")
49
50
  end
50
51
  end
51
52
 
@@ -1,4 +1,6 @@
1
+ # frozen_string_literal: true
1
2
  # coding: utf-8
3
+
2
4
  module Paperclip
3
5
  module Storage
4
6
  # Amazon's S3 file hosting service is a scalable, easy place to store files for
@@ -126,8 +128,7 @@ module Paperclip
126
128
  begin
127
129
  require "aws-sdk-s3"
128
130
  rescue LoadError => e
129
- e.message << " (You may need to install the aws-sdk-s3 gem)"
130
- raise e
131
+ raise("#{e.message} (You may need to install the aws-sdk-s3 gem)")
131
132
  end
132
133
 
133
134
  base.instance_eval do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "paperclip/storage/filesystem"
2
4
  require "paperclip/storage/fog"
3
5
  require "paperclip/storage/s3"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  # The Style class holds the definition of a thumbnail style, applying
3
5
  # whatever processing is required to normalize the definition and delaying
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  # Overriding some implementation of Tempfile
3
5
  class Tempfile < ::Tempfile
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  class TempfileFactory
3
5
  def generate(name = random_name)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "shellwords"
2
4
 
3
5
  module Paperclip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "uri"
2
4
  require "active_support/core_ext/module/delegation"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module Validators
3
5
  class AttachmentContentTypeValidator < ActiveModel::EachValidator
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
4
  module Validators
3
5
  class AttachmentFileNameValidator < ActiveModel::EachValidator
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_model/validations/presence"
2
4
 
3
5
  module Paperclip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_model/validations/presence"
2
4
 
3
5
  module Paperclip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_model/validations/numericality"
2
4
 
3
5
  module Paperclip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_model/validations/presence"
2
4
 
3
5
  module Paperclip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_model"
2
4
  require "active_support/concern"
3
5
  require "active_support/core_ext/array/wrap"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Paperclip
2
- VERSION = "8.0.3".freeze
4
+ VERSION = "8.0.4".freeze
3
5
  end
data/lib/paperclip.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Paperclip allows file attachments that are stored in the filesystem. Graphical
2
4
  # transformations are done using command line utilities (ImageMagick or libvips) and
3
5
  # are stored in Tempfiles until the record is saved. Paperclip does not require a
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "paperclip/attachment_registry"
2
4
 
3
5
  module Paperclip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "paperclip/matchers"
2
4
 
3
5
  module Paperclip
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jr-paperclip
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.3
4
+ version: 8.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jukka Rautanen
@@ -487,7 +487,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
487
487
  version: '0'
488
488
  requirements:
489
489
  - ImageMagick or libvips
490
- rubygems_version: 3.7.0
490
+ rubygems_version: 4.0.6
491
491
  specification_version: 4
492
492
  summary: File attachments as attributes for ActiveRecord
493
493
  test_files: []