# File lib/camping-unabridged.rb, line 201 201: def R(c,*g) 202: p,h=/\(.+?\)/,g.grep(Hash) 203: g-=h 204: raise "bad route" unless u = c.urls.find{|x| 205: break x if x.scan(p).size == g.size && 206: /^#{x}\/?$/ =~ (x=g.inject(x){|x,a| 207: x.sub p,U.escape((a.to_param rescue a))}.gsub(/\\(.)/){$1}) 208: } 209: h.any?? u+"?"+U.build_query(h[0]) : u 210: end