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 a Cron4s config writer #457

Merged
merged 3 commits into from
Apr 13, 2019

Conversation

alonsodomin
Copy link
Contributor

No description provided.

Copy link
Member

@ruippeixotog ruippeixotog left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, @alonsodomin!

ConfigReader.fromString(str =>
Cron.parse(str).fold(
err => Left(CannotConvert(str, "CronExpr", err.getMessage)),
cronExpr => Right(cronExpr)))

implicit val cronExprConfigWriter: ConfigWriter[CronExpr] =
Copy link
Member

@ruippeixotog ruippeixotog Apr 12, 2019

Choose a reason for hiding this comment

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

Can you combine the reader and writer parts in a ConfigConvert? You should be able to do that easily with ConfigConvert.viaString (see pureconfig-joda for examples).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ruippeixotog thanks to the pointer to ConfigConvert, wasn't aware of its existance. Should be sorted now.

Copy link
Member

@jcazevedo jcazevedo left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for this, @alonsodomin!

@ruippeixotog ruippeixotog merged commit 5254840 into pureconfig:master Apr 13, 2019
@leifwickland
Copy link
Collaborator

@alonsodomin Thanks for your contribution. Please consider sending a PR to add yourself to the pureconfig contributors list.

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.

4 participants