Sha256: 416adead13694ba3a950dba3a7b05977144f8d72a95a303d0d0b67a4e30cdbbd

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

= uri-handler

Additional string functionality to make uri encoding easier and cleaner to use in your Ruby code.

Nothing fancy going on here, this module is just a wrapper around the function CGI::escape
and CGI::unescape. Functionality is added to the String class, so just add the module and
the extra funcitons will be there for you to use (check out the basic usage example below).
I just wanted an easier and cleaner way to encode/decode uri strings for my ruby projects.

== basic usage

Add to Gemfile for rails and other bundle-enabled projects

gem 'uri-handler'

require 'uri-handler'

puts "testing+123 invalid uri character/s".to_uri # => "testing%2B123+invalid+uri+character%2Fs"

val = "testing+123 invalid uri character/s"
val.to_uri!
puts val => "testing%2B123+invalid+uri+character%2Fs"

puts val.uri_decode # => "testing+123 invalid uri character/s"

val.uri_decode!
puts val # => "testing+123 invalid uri character/s"

puts val.uri_encode # => "testing%2B123+invalid+uri+character%2Fs"

val.uri_encode!
puts val # => "testing%2B123+invalid+uri+character%2Fs"

== Copyright

Copyright (c) 2012 foomip. See LICENSE.txt for
further details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
uri-handler-1.0.1 README.rdoc