Sha256: c201a82c163259782c155db66126a83564137eea003b2c5549a111d587009d2c

Contents?: true

Size: 415 Bytes

Versions: 10

Compression:

Stored size: 415 Bytes

Contents

# TEMPORARY SOLUTION
# Remove when Rack is fixed upstream
module Rack
  module Utils
    def escape(s)
      regexp = case
        when RUBY_VERSION >= "1.9" && s.encoding === Encoding.find('UTF-8')
          /([^ a-zA-Z0-9_.-]+)/u
        else
          /([^ a-zA-Z0-9_.-]+)/n
        end
      s.to_s.gsub(regexp) {
        '%'+$1.unpack('H2'*bytesize($1)).join('%').upcase
      }.tr(' ', '+')
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
refinerycms-0.9.8.9 config/initializers/fix_rack.rb
refinerycms-0.9.8.8 config/initializers/fix_rack.rb
refinerycms-0.9.8.7 config/initializers/fix_rack.rb
refinerycms-0.9.8.6 config/initializers/fix_rack.rb
refinerycms-0.9.8.5 config/initializers/fix_rack.rb
refinerycms-0.9.8.4 config/initializers/fix_rack.rb
refinerycms-0.9.8.3 config/initializers/fix_rack.rb
refinerycms-0.9.8.2 config/initializers/fix_rack.rb
refinerycms-0.9.8.1 config/initializers/fix_rack.rb
refinerycms-0.9.8 config/initializers/fix_rack.rb