kontrakt
Version, currently 0.2.09 versions
github.com/ragmaanir/kontrakt
Simple design by contract for crystal
Nothing has been indexed for 0.2.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
kontrakt:
github: ragmaanir/kontrakt
version: ~> 0.2.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.2.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
kontrakt 
Kontrakt provides two macros to implement very simple design-by-contract style checks.
Installation
Add this to your application's shard.yml:
dependencies:
kontrakt:
github: ragmaanir/kontrakt
Usage
require "kontrakt"
Kontrakt.precondition(1 == 5) # raises
Kontrakt.postcondition(3 == 3 && true != false) # passes
To disable the conditions set DISABLE_CONTRACTS env var:
DISABLE_CONTRACTS=1 crystal spec
TODO
- output the values of the variables used
- evaluate partial expressions like power_assert.cr. maybe only show leaf-values, e.g. dont show
x && y, just showxandy
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.0- Tagged
- May 5, 2021
- Commit
56017a428f0d- Indexed
- not yet
Dependents
Repository
github.com/ragmaanir/kontrakt
Metadata
- Created
- Aug 18, 2026
- Updated
- Sep 26, 2026
- Synced
- Sep 26, 2026
- Versions
- 9