nshki / chusaku

Annotate your Rails controllers with route info.
https://rubygems.org/gems/chusaku
MIT License
87 stars 4 forks source link

Account for regular expressions containing multiple verbs #13

Closed nshki closed 4 years ago

nshki commented 4 years ago

Problem

Older versions of Rails (e.g. 4.2) return regular expressions instead of strings for a route verb. This results in Chusaku outputting routes that may look like:

# @route (?-mix:^GET$) /some/path (helper_to_path)

Solution

Account for said regular expressions that may be returned by a route verb, extract HTTP verbs being used, and remove duplicates.