Sha256: c8401c2c5383917ffb54689006fcfce5b66ddaa6071ad38865f5e2fda9abd56e

Contents?: true

Size: 335 Bytes

Versions: 39

Compression:

Stored size: 335 Bytes

Contents

# encoding: utf-8
module Paperclip
  class FilenameCleaner
    def initialize(invalid_character_regex)
      @invalid_character_regex = invalid_character_regex
    end

    def call(filename)
      if @invalid_character_regex
        filename.gsub(@invalid_character_regex, "_")
      else
        filename
      end
    end
  end
end

Version data entries

39 entries across 37 versions & 6 rubygems

Version Path
kt-paperclip-5.4.0 lib/paperclip/filename_cleaner.rb
kt-paperclip-4.4.0 lib/paperclip/filename_cleaner.rb
paperclip-6.0.0 lib/paperclip/filename_cleaner.rb
paperclip-5.3.0 lib/paperclip/filename_cleaner.rb
paperclip-5.2.1 lib/paperclip/filename_cleaner.rb
paperclip-5.2.0 lib/paperclip/filename_cleaner.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/paperclip-5.1.0/lib/paperclip/filename_cleaner.rb
paperclip-5.1.0 lib/paperclip/filename_cleaner.rb
paperclip-5.0.0 lib/paperclip/filename_cleaner.rb
paperclip-4.3.7 lib/paperclip/filename_cleaner.rb
paperclip_jk-5.0.0.beta2 lib/paperclip/filename_cleaner.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/paperclip-4.3.6/lib/paperclip/filename_cleaner.rb
paperclip-5.0.0.beta2 lib/paperclip/filename_cleaner.rb
paperclip-5.0.0.beta1 lib/paperclip/filename_cleaner.rb
paperclip-4.3.6 lib/paperclip/filename_cleaner.rb
paperclip-4.3.5 lib/paperclip/filename_cleaner.rb
paperclip-4.3.4 lib/paperclip/filename_cleaner.rb
paperclip-4.3.3 lib/paperclip/filename_cleaner.rb
paperclip-4.3.2 lib/paperclip/filename_cleaner.rb
paperclip-4.3.1 lib/paperclip/filename_cleaner.rb