todo_or_diehard 0.3.0
TODO or Die Hard
TodoOrDiehard
provides macros for Crystal that implement compile-time and runtime checked reminders.
Inspired by todo_or_die for Ruby.
Installation
-
Add the dependency to your
shard.yml
:dependencies: todo_or_diehard: github: nogginly/todo_or_diehard
-
Run
shards install
Usage
require "todo_or_diehard"
# Warning only, does not raise an exception or compile-time error
TodoOrDie["Whaaa Whaaa Whaaa!", warn_by: {2020, 1, 20}]
# Raises an OverdueTodo error
TodoOrDie["Blammo!", by: [2020, 2, 28]]
Warning only
TodoOrDie["Whaaa Whaaa Whaaa!", warn_by: {2020, 1, 20}]
# or
TodoOrDie[warning: "Whaaa Whaaa Whaaa!", y: 2020, m: 1, d: 20]
- If overdue
- logs a warning
- does not raise a compile time error or a run-time error
- Otherwise
- logs an
Info
at compile-time
- logs an
Die hard (if overdue)
TodoOrDie["Blammo!", by: [2020, 2, 28]]
# or
TodoOrDie["Blammo!", y: 2020, m: 2, d: 28]
- If overdue
- raises a compile time error when building
- raises a run-time error when run after deadline
- Otherwise
- logs an
Info
at compile-time
- logs an
Q&A
Why can't I use Time
to set the deadline?
The standard library is not available at compile-time, and for this to work with macros we can't use Time
. As a side benefit, this made the API simpler by asking for year, month, date arguments.
Contributing
Bug reports and sugestions are welcome. Otherwise, at this time, this project is closed for code changes and pull requests. I appreciate your understanding.
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
Contributors
- nogginly - creator and maintainer
todo_or_diehard
- 4
- 0
- 0
- 0
- 0
- over 1 year ago
- February 27, 2023
MIT License
Sat, 07 Sep 2024 21:08:53 GMT