Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iku000888
Copy link

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?

Copy link
Contributor

@weavejester weavejester left a 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?

@@ -110,7 +111,8 @@
(merge
{'duct/env env/env
'duct/include (make-include readers)
'duct/resource resource}
'duct/resource resource
'duct/regex #(Pattern/compile %)}
Copy link
Contributor

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?

Copy link
Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep!

@iku000888 iku000888 force-pushed the feature/regex-reader-tag branch from fd56e7f to dab4953 Compare March 29, 2019 00:35
@iku000888
Copy link
Author

You know that custom reader tags can be specified, right?

Yes and that is what I do right now and works great & happy with that, so it is totally up to you ;)

@iku000888 iku000888 force-pushed the feature/regex-reader-tag branch from dab4953 to 6ccb1ac Compare March 29, 2019 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants