Sha256: a6a96919477fdb8d44c30ca1835e31d82eb1f1c17aff6268f6b6490c1c056aca

Contents?: true

Size: 328 Bytes

Versions: 19

Compression:

Stored size: 328 Bytes

Contents

class Uri
  #
  def self.escape_raw(st)
    st.gsub(/([^a-zA-Z0-9_\-\.~])/) { "%#{$1.unpack('H*')[0].scan(/../).join('%').upcase }" }
  end

  #
  # usage
  # @search_tag = Uri.unescape_raw(params[:tag]).toutf8
  #
  def self.unescape_raw(st)
    st.tr('+',' ').gsub(/%([A-Fa-f0-9][A-Fa-f0-9])/) { [$1.hex].pack('C') }
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
kanamei-kanamei-keystone-0.0.12 lib/keystone/core_ext/uri.rb
kanamei-kanamei-keystone-0.0.13 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.11 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.12 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.14 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.15 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.16 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.17 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.18 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.19 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.20 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.21 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.22 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.23 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.24 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.25 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.26 lib/keystone/core_ext/uri.rb
kanamei-keystone-0.0.27 lib/keystone/core_ext/uri.rb
keystone-0.0.29 lib/keystone/core_ext/uri.rb