Skip to content

Template doesn't support symbols #113

Closed
abotalov opened this Issue Apr 2, 2013 · 2 comments

3 participants

@abotalov
abotalov commented Apr 2, 2013
andrey@andrey-K55VM:~$ irb
1.9.3p392 :004 > require 'addressable/template'
 => true 
1.9.3p392 :005 > Addressable::Template.new("/search{?query*}").expand(query: {color: 'red', text: 'blue'})
NoMethodError: undefined method `unpack' for :color:Symbol

But this works:
Addressable::Template.new("/search{?query*}").expand(query: {'color' => 'red', 'text' => 'blue'})

Is this behavior intentional? I think it will be useful to support symbols.

Found here - natritmeyer/site_prism#27

@adstage-david

Started looking into this, it appears to come from a dependency on 'idn-ruby' (or 'idn' on Ruby 1.8). Making that gem available fixes the issue for me.

I believe this is a bug because the readme states that dependency as optional. Writing up a fix for it.

@sporkmonger
Owner

Well, it's possible that the best thing to do here is to convert Symbol objects to a String before performing Unicode normalization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.