paperclip 4.3.6 → 4.3.7
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.
Potentially problematic release.
This version of paperclip might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/NEWS +6 -0
- data/lib/paperclip.rb +2 -0
- data/lib/paperclip/deprecations.rb +42 -0
- data/lib/paperclip/io_adapters/uri_adapter.rb +30 -11
- data/lib/paperclip/storage/fog.rb +8 -2
- data/lib/paperclip/version.rb +1 -1
- data/spec/paperclip/deprecations_spec.rb +65 -0
- data/spec/paperclip/io_adapters/http_url_proxy_adapter_spec.rb +8 -5
- data/spec/paperclip/io_adapters/uri_adapter_spec.rb +31 -6
- data/spec/paperclip/paperclip_spec.rb +5 -0
- data/spec/paperclip/storage/fog_spec.rb +19 -0
- data/spec/support/deprecations.rb +9 -0
- metadata +8 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 43295d174585b0f901e4582c9a187ac89c8bfcdf
         | 
| 4 | 
            +
              data.tar.gz: 48a869b66081613bc8ecef28d9b311007f61f082
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 88697737772a0e776549b80dcf4b45e42aeb57ec3cf3432827356d410c9e2abaf3bb5072be70728798c04bc5ec844715e14de5d013dbe2debe49601c73e4ad1e
         | 
| 7 | 
            +
              data.tar.gz: 2ca1c276224bf3134d9df3a3df41a69ff4e19c35374043a2fa3c634529548875bc32b25cfc0bf61b58d792d01f0b740c90c849a794a520b97671e9efe96de3e9
         | 
    
        data/NEWS
    CHANGED
    
    | @@ -1,3 +1,9 @@ | |
| 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 | 
            +
             | 
| 1 7 | 
             
            4.3.6 (3/13/2016):
         | 
| 2 8 |  | 
| 3 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.
         | 
    
        data/lib/paperclip.rb
    CHANGED
    
    | @@ -56,6 +56,7 @@ require 'paperclip/has_attached_file' | |
| 56 56 | 
             
            require 'paperclip/attachment_registry'
         | 
| 57 57 | 
             
            require 'paperclip/filename_cleaner'
         | 
| 58 58 | 
             
            require 'paperclip/rails_environment'
         | 
| 59 | 
            +
            require "paperclip/deprecations"
         | 
| 59 60 |  | 
| 60 61 | 
             
            begin
         | 
| 61 62 | 
             
              # Use mime/types/columnar if available, for reduced memory usage
         | 
| @@ -191,6 +192,7 @@ module Paperclip | |
| 191 192 | 
             
                #     end
         | 
| 192 193 | 
             
                #   end
         | 
| 193 194 | 
             
                def has_attached_file(name, options = {})
         | 
| 195 | 
            +
                  Paperclip::Deprecations.check
         | 
| 194 196 | 
             
                  HasAttachedFile.define_on(self, name, options)
         | 
| 195 197 | 
             
                end
         | 
| 196 198 | 
             
              end
         | 
| @@ -0,0 +1,42 @@ | |
| 1 | 
            +
            require "active_support/deprecation"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Paperclip
         | 
| 4 | 
            +
              class Deprecations
         | 
| 5 | 
            +
                class << self
         | 
| 6 | 
            +
                  def check
         | 
| 7 | 
            +
                    warn_aws_sdk_v1 if aws_sdk_v1?
         | 
| 8 | 
            +
                    warn_outdated_rails if active_model_version < "4.2"
         | 
| 9 | 
            +
                  end
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                  private
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                  def active_model_version
         | 
| 14 | 
            +
                    ::ActiveModel::VERSION::STRING
         | 
| 15 | 
            +
                  end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                  def aws_sdk_v1?
         | 
| 18 | 
            +
                    defined?(::AWS) && aws_sdk_version < "2"
         | 
| 19 | 
            +
                  end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                  def warn_aws_sdk_v1
         | 
| 22 | 
            +
                    warn "[paperclip] [deprecation] AWS SDK v1 has been deprecated in " \
         | 
| 23 | 
            +
                         "paperclip 5. Please consider upgrading to AWS 2 before " \
         | 
| 24 | 
            +
                         "upgrading paperclip."
         | 
| 25 | 
            +
                  end
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                  def warn_outdated_rails
         | 
| 28 | 
            +
                    warn "[paperclip] [deprecation] Rails 3.2 and 4.1 are unsupported as " \
         | 
| 29 | 
            +
                         "of Rails 5 release. Please upgrade to Rails 4.2 before " \
         | 
| 30 | 
            +
                         "upgrading paperclip."
         | 
| 31 | 
            +
                  end
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                  def aws_sdk_version
         | 
| 34 | 
            +
                    ::AWS::VERSION
         | 
| 35 | 
            +
                  end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                  def warn(message)
         | 
| 38 | 
            +
                    ActiveSupport::Deprecation.warn(message)
         | 
| 39 | 
            +
                  end
         | 
| 40 | 
            +
                end
         | 
| 41 | 
            +
              end
         | 
| 42 | 
            +
            end
         | 
| @@ -2,6 +2,8 @@ require 'open-uri' | |
| 2 2 |  | 
| 3 3 | 
             
            module Paperclip
         | 
| 4 4 | 
             
              class UriAdapter < AbstractAdapter
         | 
| 5 | 
            +
                attr_writer :content_type
         | 
| 6 | 
            +
             | 
| 5 7 | 
             
                def initialize(target)
         | 
| 6 8 | 
             
                  @target = target
         | 
| 7 9 | 
             
                  @content = download_content
         | 
| @@ -9,23 +11,40 @@ module Paperclip | |
| 9 11 | 
             
                  @tempfile = copy_to_tempfile(@content)
         | 
| 10 12 | 
             
                end
         | 
| 11 13 |  | 
| 12 | 
            -
                attr_writer :content_type
         | 
| 13 | 
            -
             | 
| 14 14 | 
             
                private
         | 
| 15 15 |  | 
| 16 | 
            -
                def  | 
| 17 | 
            -
                   | 
| 16 | 
            +
                def cache_current_values
         | 
| 17 | 
            +
                  self.content_type = content_type_from_content || "text/html"
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                  self.original_filename = filename_from_content_disposition ||
         | 
| 20 | 
            +
                                           filename_from_path ||
         | 
| 21 | 
            +
                                           default_filename
         | 
| 22 | 
            +
                  @size = @content.size
         | 
| 18 23 | 
             
                end
         | 
| 19 24 |  | 
| 20 | 
            -
                def  | 
| 21 | 
            -
                   | 
| 22 | 
            -
             | 
| 23 | 
            -
                   | 
| 25 | 
            +
                def content_type_from_content
         | 
| 26 | 
            +
                  if @content.respond_to?(:content_type)
         | 
| 27 | 
            +
                    @content.content_type
         | 
| 28 | 
            +
                  end
         | 
| 29 | 
            +
                end
         | 
| 24 30 |  | 
| 25 | 
            -
             | 
| 26 | 
            -
                  @ | 
| 31 | 
            +
                def filename_from_content_disposition
         | 
| 32 | 
            +
                  if @content.meta.has_key?("content-disposition")
         | 
| 33 | 
            +
                    @content.meta["content-disposition"].
         | 
| 34 | 
            +
                      match(/filename="([^"]*)"/)[1]
         | 
| 35 | 
            +
                  end
         | 
| 36 | 
            +
                end
         | 
| 27 37 |  | 
| 28 | 
            -
             | 
| 38 | 
            +
                def filename_from_path
         | 
| 39 | 
            +
                  @target.path.split("/").last
         | 
| 40 | 
            +
                end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                def default_filename
         | 
| 43 | 
            +
                  "index.html"
         | 
| 44 | 
            +
                end
         | 
| 45 | 
            +
             | 
| 46 | 
            +
                def download_content
         | 
| 47 | 
            +
                  open(@target)
         | 
| 29 48 | 
             
                end
         | 
| 30 49 |  | 
| 31 50 | 
             
                def copy_to_tempfile(src)
         | 
| @@ -33,6 +33,10 @@ module Paperclip | |
| 33 33 | 
             
                #   that is the alias to the S3 domain of your bucket, e.g.
         | 
| 34 34 | 
             
                #   'http://images.example.com'. This can also be used in
         | 
| 35 35 | 
             
                #   conjunction with Cloudfront (http://aws.amazon.com/cloudfront)
         | 
| 36 | 
            +
                # * +fog_options+: (optional) A hash of options that are passed
         | 
| 37 | 
            +
                #   to fog when the file is created. For example, you could set
         | 
| 38 | 
            +
                #   the multipart-chunk size to 100MB with a hash:
         | 
| 39 | 
            +
                #     { :multipart_chunk_size => 104857600 }
         | 
| 36 40 |  | 
| 37 41 | 
             
                module Fog
         | 
| 38 42 | 
             
                  def self.extended base
         | 
| @@ -98,12 +102,14 @@ module Paperclip | |
| 98 102 | 
             
                      log("saving #{path(style)}")
         | 
| 99 103 | 
             
                      retried = false
         | 
| 100 104 | 
             
                      begin
         | 
| 101 | 
            -
                         | 
| 105 | 
            +
                        attributes = fog_file.merge(
         | 
| 102 106 | 
             
                          :body         => file,
         | 
| 103 107 | 
             
                          :key          => path(style),
         | 
| 104 108 | 
             
                          :public       => fog_public(style),
         | 
| 105 109 | 
             
                          :content_type => file.content_type
         | 
| 106 | 
            -
                        ) | 
| 110 | 
            +
                        )
         | 
| 111 | 
            +
                        attributes.merge!(@options[:fog_options]) if @options[:fog_options]
         | 
| 112 | 
            +
                        directory.files.create(attributes)
         | 
| 107 113 | 
             
                      rescue Excon::Errors::NotFound
         | 
| 108 114 | 
             
                        raise if retried
         | 
| 109 115 | 
             
                        retried = true
         | 
    
        data/lib/paperclip/version.rb
    CHANGED
    
    
| @@ -0,0 +1,65 @@ | |
| 1 | 
            +
            require "spec_helper"
         | 
| 2 | 
            +
            require "aws-sdk"
         | 
| 3 | 
            +
            require "active_support/testing/deprecation"
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            describe Paperclip::Deprecations do
         | 
| 6 | 
            +
              include ActiveSupport::Testing::Deprecation
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              describe ".check" do
         | 
| 9 | 
            +
                before do
         | 
| 10 | 
            +
                  ActiveSupport::Deprecation.silenced = false
         | 
| 11 | 
            +
                end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                after do
         | 
| 14 | 
            +
                  ActiveSupport::Deprecation.silenced = true
         | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                context "when active model version is < 4.2" do
         | 
| 18 | 
            +
                  it "displays deprecation warning" do
         | 
| 19 | 
            +
                    Paperclip::Deprecations.stubs(:active_model_version).returns("4.1")
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                    assert_deprecated("Rails 3.2 and 4.1 are unsupported") do
         | 
| 22 | 
            +
                      Paperclip::Deprecations.check
         | 
| 23 | 
            +
                    end
         | 
| 24 | 
            +
                  end
         | 
| 25 | 
            +
                end
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                context "when active model version is 4.2" do
         | 
| 28 | 
            +
                  it "do not display deprecation warning" do
         | 
| 29 | 
            +
                    Paperclip::Deprecations.stubs(:active_model_version).returns("4.2")
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                    assert_not_deprecated do
         | 
| 32 | 
            +
                      Paperclip::Deprecations.check
         | 
| 33 | 
            +
                    end
         | 
| 34 | 
            +
                  end
         | 
| 35 | 
            +
                end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                context "when aws sdk version is < 2" do
         | 
| 38 | 
            +
                  before do
         | 
| 39 | 
            +
                    ::AWS.stub! if !defined?(::AWS)
         | 
| 40 | 
            +
                  end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                  it "displays deprecation warning" do
         | 
| 43 | 
            +
                    Paperclip::Deprecations.stubs(:aws_sdk_version).returns("1.68.0")
         | 
| 44 | 
            +
             | 
| 45 | 
            +
                    assert_deprecated("AWS SDK v1 has been deprecated") do
         | 
| 46 | 
            +
                      Paperclip::Deprecations.check
         | 
| 47 | 
            +
                    end
         | 
| 48 | 
            +
                  end
         | 
| 49 | 
            +
                end
         | 
| 50 | 
            +
             | 
| 51 | 
            +
                context "when aws sdk version is 2" do
         | 
| 52 | 
            +
                  before do
         | 
| 53 | 
            +
                    ::AWS.stub! if !defined?(::AWS)
         | 
| 54 | 
            +
                  end
         | 
| 55 | 
            +
             | 
| 56 | 
            +
                  it "do not display deprecation warning" do
         | 
| 57 | 
            +
                    Paperclip::Deprecations.stubs(:aws_sdk_version).returns("2.0.0")
         | 
| 58 | 
            +
             | 
| 59 | 
            +
                    assert_not_deprecated do
         | 
| 60 | 
            +
                      Paperclip::Deprecations.check
         | 
| 61 | 
            +
                    end
         | 
| 62 | 
            +
                  end
         | 
| 63 | 
            +
                end
         | 
| 64 | 
            +
              end
         | 
| 65 | 
            +
            end
         | 
| @@ -1,11 +1,16 @@ | |
| 1 1 | 
             
            require 'spec_helper'
         | 
| 2 2 |  | 
| 3 3 | 
             
            describe Paperclip::HttpUrlProxyAdapter do
         | 
| 4 | 
            +
              before do
         | 
| 5 | 
            +
                @open_return = StringIO.new("xxx")
         | 
| 6 | 
            +
                @open_return.stubs(:content_type).returns("image/png")
         | 
| 7 | 
            +
                @open_return.stubs(:meta).returns({})
         | 
| 8 | 
            +
                Paperclip::HttpUrlProxyAdapter.any_instance.
         | 
| 9 | 
            +
                  stubs(:download_content).returns(@open_return)
         | 
| 10 | 
            +
              end
         | 
| 11 | 
            +
             | 
| 4 12 | 
             
              context "a new instance" do
         | 
| 5 13 | 
             
                before do
         | 
| 6 | 
            -
                  @open_return = StringIO.new("xxx")
         | 
| 7 | 
            -
                  @open_return.stubs(:content_type).returns("image/png")
         | 
| 8 | 
            -
                  Paperclip::HttpUrlProxyAdapter.any_instance.stubs(:download_content).returns(@open_return)
         | 
| 9 14 | 
             
                  @url = "http://thoughtbot.com/images/thoughtbot-logo.png"
         | 
| 10 15 | 
             
                  @subject = Paperclip.io_adapters.for(@url)
         | 
| 11 16 | 
             
                end
         | 
| @@ -60,7 +65,6 @@ describe Paperclip::HttpUrlProxyAdapter do | |
| 60 65 |  | 
| 61 66 | 
             
              context "a url with query params" do
         | 
| 62 67 | 
             
                before do
         | 
| 63 | 
            -
                  Paperclip::HttpUrlProxyAdapter.any_instance.stubs(:download_content).returns(StringIO.new("x"))
         | 
| 64 68 | 
             
                  @url = "https://github.com/thoughtbot/paperclip?file=test"
         | 
| 65 69 | 
             
                  @subject = Paperclip.io_adapters.for(@url)
         | 
| 66 70 | 
             
                end
         | 
| @@ -76,7 +80,6 @@ describe Paperclip::HttpUrlProxyAdapter do | |
| 76 80 |  | 
| 77 81 | 
             
              context "a url with restricted characters in the filename" do
         | 
| 78 82 | 
             
                before do
         | 
| 79 | 
            -
                  Paperclip::HttpUrlProxyAdapter.any_instance.stubs(:download_content).returns(StringIO.new("x"))
         | 
| 80 83 | 
             
                  @url = "https://github.com/thoughtbot/paper:clip.jpg"
         | 
| 81 84 | 
             
                  @subject = Paperclip.io_adapters.for(@url)
         | 
| 82 85 | 
             
                end
         | 
| @@ -1,11 +1,19 @@ | |
| 1 1 | 
             
            require 'spec_helper'
         | 
| 2 2 |  | 
| 3 3 | 
             
            describe Paperclip::UriAdapter do
         | 
| 4 | 
            +
              let(:content_type) { "image/png" }
         | 
| 5 | 
            +
              let(:meta) { {} }
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              before do
         | 
| 8 | 
            +
                @open_return = StringIO.new("xxx")
         | 
| 9 | 
            +
                @open_return.stubs(:content_type).returns(content_type)
         | 
| 10 | 
            +
                @open_return.stubs(:meta).returns(meta)
         | 
| 11 | 
            +
                Paperclip::UriAdapter.any_instance.
         | 
| 12 | 
            +
                  stubs(:download_content).returns(@open_return)
         | 
| 13 | 
            +
              end
         | 
| 14 | 
            +
             | 
| 4 15 | 
             
              context "a new instance" do
         | 
| 5 16 | 
             
                before do
         | 
| 6 | 
            -
                  @open_return = StringIO.new("xxx")
         | 
| 7 | 
            -
                  @open_return.stubs(:content_type).returns("image/png")
         | 
| 8 | 
            -
                  Paperclip::UriAdapter.any_instance.stubs(:download_content).returns(@open_return)
         | 
| 9 17 | 
             
                  @uri = URI.parse("http://thoughtbot.com/images/thoughtbot-logo.png")
         | 
| 10 18 | 
             
                  @subject = Paperclip.io_adapters.for(@uri)
         | 
| 11 19 | 
             
                end
         | 
| @@ -56,8 +64,9 @@ describe Paperclip::UriAdapter do | |
| 56 64 | 
             
              end
         | 
| 57 65 |  | 
| 58 66 | 
             
              context "a directory index url" do
         | 
| 67 | 
            +
                let(:content_type) { "text/html" }
         | 
| 68 | 
            +
             | 
| 59 69 | 
             
                before do
         | 
| 60 | 
            -
                  Paperclip::UriAdapter.any_instance.stubs(:download_content).returns(StringIO.new("xxx"))
         | 
| 61 70 | 
             
                  @uri = URI.parse("http://thoughtbot.com")
         | 
| 62 71 | 
             
                  @subject = Paperclip.io_adapters.for(@uri)
         | 
| 63 72 | 
             
                end
         | 
| @@ -73,7 +82,6 @@ describe Paperclip::UriAdapter do | |
| 73 82 |  | 
| 74 83 | 
             
              context "a url with query params" do
         | 
| 75 84 | 
             
                before do
         | 
| 76 | 
            -
                  Paperclip::UriAdapter.any_instance.stubs(:download_content).returns(StringIO.new("xxx"))
         | 
| 77 85 | 
             
                  @uri = URI.parse("https://github.com/thoughtbot/paperclip?file=test")
         | 
| 78 86 | 
             
                  @subject = Paperclip.io_adapters.for(@uri)
         | 
| 79 87 | 
             
                end
         | 
| @@ -83,9 +91,26 @@ describe Paperclip::UriAdapter do | |
| 83 91 | 
             
                end
         | 
| 84 92 | 
             
              end
         | 
| 85 93 |  | 
| 94 | 
            +
              context "a url with content disposition headers" do
         | 
| 95 | 
            +
                let(:file_name) { "test_document.pdf" }
         | 
| 96 | 
            +
                let(:meta) do
         | 
| 97 | 
            +
                  {
         | 
| 98 | 
            +
                    "content-disposition" => "attachment; filename=\"#{file_name}\";",
         | 
| 99 | 
            +
                  }
         | 
| 100 | 
            +
                end
         | 
| 101 | 
            +
             | 
| 102 | 
            +
                before do
         | 
| 103 | 
            +
                  @uri = URI.parse("https://github.com/thoughtbot/paperclip?file=test")
         | 
| 104 | 
            +
                  @subject = Paperclip.io_adapters.for(@uri)
         | 
| 105 | 
            +
                end
         | 
| 106 | 
            +
             | 
| 107 | 
            +
                it "returns a file name" do
         | 
| 108 | 
            +
                  assert_equal file_name, @subject.original_filename
         | 
| 109 | 
            +
                end
         | 
| 110 | 
            +
              end
         | 
| 111 | 
            +
             | 
| 86 112 | 
             
              context "a url with restricted characters in the filename" do
         | 
| 87 113 | 
             
                before do
         | 
| 88 | 
            -
                  Paperclip::UriAdapter.any_instance.stubs(:download_content).returns(StringIO.new("xxx"))
         | 
| 89 114 | 
             
                  @uri = URI.parse("https://github.com/thoughtbot/paper:clip.jpg")
         | 
| 90 115 | 
             
                  @subject = Paperclip.io_adapters.for(@uri)
         | 
| 91 116 | 
             
                end
         | 
| @@ -109,6 +109,7 @@ describe Paperclip do | |
| 109 109 |  | 
| 110 110 | 
             
              context "An ActiveRecord model with an 'avatar' attachment" do
         | 
| 111 111 | 
             
                before do
         | 
| 112 | 
            +
                  Paperclip::Deprecations.stubs(:check)
         | 
| 112 113 | 
             
                  rebuild_model path: "tmp/:class/omg/:style.:extension"
         | 
| 113 114 | 
             
                  @file = File.new(fixture_file("5k.png"), 'rb')
         | 
| 114 115 | 
             
                end
         | 
| @@ -150,6 +151,10 @@ describe Paperclip do | |
| 150 151 | 
             
                  end
         | 
| 151 152 | 
             
                end
         | 
| 152 153 |  | 
| 154 | 
            +
                it "calls Paperclip::Deprecations.check" do
         | 
| 155 | 
            +
                  expect(Paperclip::Deprecations).to have_received(:check)
         | 
| 156 | 
            +
                end
         | 
| 157 | 
            +
             | 
| 153 158 | 
             
                context "with a subclass" do
         | 
| 154 159 | 
             
                  before do
         | 
| 155 160 | 
             
                    class ::SubDummy < Dummy; end
         | 
| @@ -484,6 +484,25 @@ describe Paperclip::Storage::Fog do | |
| 484 484 | 
             
                      assert_equal @dummy.avatar.fog_credentials, @dynamic_fog_credentials
         | 
| 485 485 | 
             
                    end
         | 
| 486 486 | 
             
                  end
         | 
| 487 | 
            +
             | 
| 488 | 
            +
                  context "with custom fog_options" do
         | 
| 489 | 
            +
                    before do
         | 
| 490 | 
            +
                      rebuild_model(
         | 
| 491 | 
            +
                        @options.merge(fog_options: { multipart_chunk_size: 104857600 }),
         | 
| 492 | 
            +
                      )
         | 
| 493 | 
            +
                      @dummy = Dummy.new
         | 
| 494 | 
            +
                      @dummy.avatar = @file
         | 
| 495 | 
            +
                    end
         | 
| 496 | 
            +
             | 
| 497 | 
            +
                    it "applies the options to the fog #create call" do
         | 
| 498 | 
            +
                      files = stub
         | 
| 499 | 
            +
                      @dummy.avatar.stubs(:directory).returns stub(files: files)
         | 
| 500 | 
            +
                      files.expects(:create).with(
         | 
| 501 | 
            +
                        has_entries(multipart_chunk_size: 104857600),
         | 
| 502 | 
            +
                      )
         | 
| 503 | 
            +
                      @dummy.save
         | 
| 504 | 
            +
                    end
         | 
| 505 | 
            +
                  end
         | 
| 487 506 | 
             
                end
         | 
| 488 507 |  | 
| 489 508 | 
             
              end
         | 
| @@ -0,0 +1,9 @@ | |
| 1 | 
            +
            RSpec.configure do |config|
         | 
| 2 | 
            +
              config.before(:all) do
         | 
| 3 | 
            +
                ActiveSupport::Deprecation.silenced = true
         | 
| 4 | 
            +
              end
         | 
| 5 | 
            +
              config.before(:each) do
         | 
| 6 | 
            +
                Paperclip::Deprecations.stubs(:active_model_version).returns("4.2")
         | 
| 7 | 
            +
                Paperclip::Deprecations.stubs(:aws_sdk_version).returns("2.0.0")
         | 
| 8 | 
            +
              end
         | 
| 9 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: paperclip
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 4.3. | 
| 4 | 
            +
              version: 4.3.7
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Jon Yurek
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016- | 
| 11 | 
            +
            date: 2016-07-01 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activemodel
         | 
| @@ -429,6 +429,7 @@ files: | |
| 429 429 | 
             
            - lib/paperclip/attachment_registry.rb
         | 
| 430 430 | 
             
            - lib/paperclip/callbacks.rb
         | 
| 431 431 | 
             
            - lib/paperclip/content_type_detector.rb
         | 
| 432 | 
            +
            - lib/paperclip/deprecations.rb
         | 
| 432 433 | 
             
            - lib/paperclip/errors.rb
         | 
| 433 434 | 
             
            - lib/paperclip/file_command_content_type_detector.rb
         | 
| 434 435 | 
             
            - lib/paperclip/filename_cleaner.rb
         | 
| @@ -499,6 +500,7 @@ files: | |
| 499 500 | 
             
            - spec/paperclip/attachment_registry_spec.rb
         | 
| 500 501 | 
             
            - spec/paperclip/attachment_spec.rb
         | 
| 501 502 | 
             
            - spec/paperclip/content_type_detector_spec.rb
         | 
| 503 | 
            +
            - spec/paperclip/deprecations_spec.rb
         | 
| 502 504 | 
             
            - spec/paperclip/file_command_content_type_detector_spec.rb
         | 
| 503 505 | 
             
            - spec/paperclip/filename_cleaner_spec.rb
         | 
| 504 506 | 
             
            - spec/paperclip/geometry_detector_spec.rb
         | 
| @@ -550,6 +552,7 @@ files: | |
| 550 552 | 
             
            - spec/paperclip/validators_spec.rb
         | 
| 551 553 | 
             
            - spec/spec_helper.rb
         | 
| 552 554 | 
             
            - spec/support/assertions.rb
         | 
| 555 | 
            +
            - spec/support/deprecations.rb
         | 
| 553 556 | 
             
            - spec/support/fake_model.rb
         | 
| 554 557 | 
             
            - spec/support/fake_rails.rb
         | 
| 555 558 | 
             
            - spec/support/fixtures/12k.png
         | 
| @@ -600,7 +603,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 600 603 | 
             
            requirements:
         | 
| 601 604 | 
             
            - ImageMagick
         | 
| 602 605 | 
             
            rubyforge_project: 
         | 
| 603 | 
            -
            rubygems_version: 2. | 
| 606 | 
            +
            rubygems_version: 2.6.2
         | 
| 604 607 | 
             
            signing_key: 
         | 
| 605 608 | 
             
            specification_version: 4
         | 
| 606 609 | 
             
            summary: File attachments as attributes for ActiveRecord
         | 
| @@ -628,6 +631,7 @@ test_files: | |
| 628 631 | 
             
            - spec/paperclip/attachment_registry_spec.rb
         | 
| 629 632 | 
             
            - spec/paperclip/attachment_spec.rb
         | 
| 630 633 | 
             
            - spec/paperclip/content_type_detector_spec.rb
         | 
| 634 | 
            +
            - spec/paperclip/deprecations_spec.rb
         | 
| 631 635 | 
             
            - spec/paperclip/file_command_content_type_detector_spec.rb
         | 
| 632 636 | 
             
            - spec/paperclip/filename_cleaner_spec.rb
         | 
| 633 637 | 
             
            - spec/paperclip/geometry_detector_spec.rb
         | 
| @@ -679,6 +683,7 @@ test_files: | |
| 679 683 | 
             
            - spec/paperclip/validators_spec.rb
         | 
| 680 684 | 
             
            - spec/spec_helper.rb
         | 
| 681 685 | 
             
            - spec/support/assertions.rb
         | 
| 686 | 
            +
            - spec/support/deprecations.rb
         | 
| 682 687 | 
             
            - spec/support/fake_model.rb
         | 
| 683 688 | 
             
            - spec/support/fake_rails.rb
         | 
| 684 689 | 
             
            - spec/support/fixtures/12k.png
         |