webmachine / webmachine-ruby

Webmachine, the HTTP toolkit (in Ruby)
http://rdoc.info/github/seancribbs/webmachine-ruby/master/frames
Other
852 stars 54 forks source link

Added support for named captures #238

Closed rfestag closed 8 years ago

rfestag commented 8 years ago

This extends regex support to explicitly add in named captures. Specifically, if there are any named captures, they will be automatically added to the request.path_info with the specified name (making it easier to reference specific capture groups from the regex).

Technically, named captures support multiple captures with the same name. In order to be consistent with how symbols work right now, we only expose one (so, if you were to use the same named capture multiple times, only one of them would be available in path_info).

rfestag commented 8 years ago

Any other thoughts on this? If there are no issues, can this be merged in? On a semi-related note, are there plans for a 1.4.1 (or 1.5.0) cut of the gem at some point? Are there any required tasks before something like that is planned?

seancribbs commented 8 years ago

@rfestag Merging this, thanks! We should roll a new gem soon after this is merged, @bethesque and @lgierth have rights to push.