-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add :duct/regex reader tag #21
base: master
Are you sure you want to change the base?
Add :duct/regex reader tag #21
Conversation
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 seems reasonable, but I'll need to think about it.
You know that custom reader tags can be specified, right?
src/duct/core.clj
Outdated
@@ -110,7 +111,8 @@ | |||
(merge | |||
{'duct/env env/env | |||
'duct/include (make-include readers) | |||
'duct/resource resource} | |||
'duct/resource resource | |||
'duct/regex #(Pattern/compile %)} |
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.
Could this be changed to re-compile
?
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.
Did you mean re-pattern
?
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.
Yep!
fd56e7f
to
dab4953
Compare
Yes and that is what I do right now and works great & happy with that, so it is totally up to you ;) |
dab4953
to
6ccb1ac
Compare
There are libs(e.g. https://github.com/r0man/ring-cors) that require regex patterns to be passed in, and it would be great if I can specify e.g.
#"some-allowed-origin"
directly in the config edn file.This however did not work because it is not part of the eden spec.
This PR is the next thing I tried in my project and was pretty happy about it. Would it make sense to have this in duct/core?