Sha256: d888903c41a9af31b0d7b425cdde51425a62578e13c555a9845c46c998789907
Contents?: true
Size: 503 Bytes
Versions: 26
Compression:
Stored size: 503 Bytes
Contents
require 'uri' module Kernel def uri( s, w=%r{[^a-zA-Z_0-9./-]} ) URI.escape( s, w ) end def unuri( s ) URI.unescape( s ) end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCKernel < Test::Unit::TestCase def test_uri assert_equal( uri("abc?xyz"), "abc%3Fxyz" ) end def test_unuri assert_equal( unuri("abc%3Fxyz"), "abc?xyz" ) end end =end
Version data entries
26 entries across 26 versions & 1 rubygems