hannesg / uri_template

A URI template library for ruby.
169 stars 85 forks source link

Colon templates uri-encode dashes #11

Open bhollis opened 10 years ago

bhollis commented 10 years ago

There seems to be a problem using :colon mode where it will encode dashes:

# With colons:
x = URITemplate.new(:colon, '/:year-:month-:day-:title.html')
x.expand(year: '2010', month: '01', day: '01', title: "foo-bar")
 => "/2010%2D01%2D01%2Dfoo-bar.html"

# With braces:
x = URITemplate.new('/{year}-{month}-{day}-{title}.html')
x.expand(year: '2010', month: '01', day: '01', title: "foo-bar")
 => "/2010-01-01-foo-bar.html"