Find file
Fetching contributors…
Cannot retrieve contributors at this time
41 lines (24 sloc) 1.05 KB


Implements the URI Template draft spec, v7


Add this line to your application's Gemfile:

gem 'ruby_uri_template'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ruby_uri_template


  1. with a UriTemplate.
  2. #expand the template with a hash of params to be used. Both Strings and Symbols are valid as keys.


tmpl ="{?q,lang}")
tmpl.expand(:q => ["dogs", "cats"], "lang" => "en_US")
# => ",cats&lang=en_US"

See the spec for other examples.

Note: Sometimes the spec fails on 1.8 because of hash-ordering. Use 1.9 or an ordered hash library if the order is important to you.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request