Sha256: 421b6d2b817cdb0ccc68c7e042ef16c4b7e5cb4ed29a390e869076b71ed3ccfd

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 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'

=== code sample

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.2 README.rdoc