Sha256: 321f7a551eb644fbc50df1986c98e95d1c58e8318d0d61d5c357dbea53c49d68
Contents?: true
Size: 501 Bytes
Versions: 24
Compression:
Stored size: 501 Bytes
Contents
require 'uri' module CarrierWave module Utilities module Uri # based on Ruby < 2.0's URI.encode SAFE_STRING = URI::REGEXP::PATTERN::UNRESERVED + '\/' UNSAFE = Regexp.new("[^#{SAFE_STRING}]", false) private def encode_path(path) path.to_s.gsub(UNSAFE) do us = $& tmp = '' us.each_byte do |uc| tmp << sprintf('%%%02X', uc) end tmp end end end # Uri end # Utilities end # CarrierWave
Version data entries
24 entries across 24 versions & 2 rubygems