Sha256: 7c757d757c9c6a7cd7c562d73fb439b6ac5bd9de1423ff63e0fcafb68b0f7655

Contents?: true

Size: 518 Bytes

Versions: 5

Compression:

Stored size: 518 Bytes

Contents

# encoding: utf-8

module CarrierWave
  module Utilities
    module Uri

    private
      def encode_path(path)
        # based on Ruby < 2.0's URI.encode
        safe_string = URI::REGEXP::PATTERN::UNRESERVED + '\/'
        unsafe = Regexp.new("[^#{safe_string}]", false)

        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

5 entries across 5 versions & 1 rubygems

Version Path
carrierwave-0.11.2 lib/carrierwave/utilities/uri.rb
carrierwave-0.11.1 lib/carrierwave/utilities/uri.rb
carrierwave-0.11.0 lib/carrierwave/utilities/uri.rb
carrierwave-0.10.0 lib/carrierwave/utilities/uri.rb
carrierwave-0.9.0 lib/carrierwave/utilities/uri.rb