Sha256: 89a41fd4986d53b1f60c6e32f4cc49459118362dc543b63070b5c83941882f23

Contents?: true

Size: 317 Bytes

Versions: 15

Compression:

Stored size: 317 Bytes

Contents

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

15 entries across 15 versions & 2 rubygems

Version Path
kt-paperclip-7.2.2 lib/paperclip/filename_cleaner.rb
kt-paperclip-7.2.1 lib/paperclip/filename_cleaner.rb
kt-paperclip-7.2.0 lib/paperclip/filename_cleaner.rb
kt-paperclip-6.4.2 lib/paperclip/filename_cleaner.rb
kt-paperclip-7.1.1 lib/paperclip/filename_cleaner.rb
kt-paperclip-7.1.0 lib/paperclip/filename_cleaner.rb
kt-paperclip-7.0.1 lib/paperclip/filename_cleaner.rb
kt-paperclip-7.0.0 lib/paperclip/filename_cleaner.rb
kt-paperclip-6.4.1 lib/paperclip/filename_cleaner.rb
kt-paperclip-6.4.0 lib/paperclip/filename_cleaner.rb
kt-paperclip-6.3.0 lib/paperclip/filename_cleaner.rb
kt-paperclip-6.2.2 lib/paperclip/filename_cleaner.rb
kt-paperclip-6.2.1 lib/paperclip/filename_cleaner.rb
kt-paperclip-6.2.0 lib/paperclip/filename_cleaner.rb
paperclip-6.1.0 lib/paperclip/filename_cleaner.rb