-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow route globbing #40
Allow route globbing #40
Conversation
If not given name, globs default to 'glob' as name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be nice to get in! Thanks for taking this on. Overall it looks fine and pretty straight forward. I just had a few spec suggestions.
|
||
class InvalidGlobError < LuckyRouterError | ||
def initialize(glob) | ||
super "Tried to define a glob as `#{glob}`, but it is invalid. Globs must be defined like `*` or given a name like `*:name`." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! This will be super helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only real way to test is getting this in to some apps! 🥳 /cc @russ 😬
Fixes #3
This will allow using a glob pattern for paths.
Unnamed Usage
Named Usage
It is required that a glob can only go on the end of the path. Adding a path like
/users/*/extra
will result in aLuckyRouter::InvalidPathError
Benchmark (with
--release
)