sinatra / mustermann

your personal string matching expert
http://sinatrarb.com/mustermann/
MIT License
664 stars 63 forks source link

[WIP] Add nested get query parameter expandation #84

Closed iguchi1124 closed 2 years ago

iguchi1124 commented 6 years ago

I'm creating this issue https://github.com/sinatra/mustermann/issues/61 examples in this pull request! What do you think about this approach?

pattern = Mustermann.new("/books/:id")
pattern.expand(:append, id: 5, include: ["foo"]) # => "/books/5?include[]=foo"
pattern.expand(:append, id: 5, foo: {bar: :baz}) # => "/books/5?foo[bar]=baz"
pattern.expand(:append, id: 5, foo: {bar: [1, 2]}) # => "/books/5?foo[bar][]=1&foo[bar][]=2"
iguchi1124 commented 6 years ago

inlin-ized and fixup this commit https://github.com/sinatra/mustermann/pull/84/commits/1e5a12d25c842c217a65acf6a6a6de8608c0e4da

iguchi1124 commented 6 years ago

Thank you for reviews 😁I'll update this pull request soon.

namusyaka commented 6 years ago

@iguchi1124 If you're going to include this fix in the 1.0.3 release, please write to that effect in the milestone issue.

namusyaka commented 6 years ago

@iguchi1124 Hey, I'm going to release new version next week. So if you'd like to include this fix at the next version, please ping me.