guard
Version, currently main branch1 version
- main branchlatestSep 30, 2023
github.com/nobodywasishere/guard.cr
No description declared in shard.yml.
0 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
guard:
github: nobodywasishere/guard.cr
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.9.2- License
- MIT
- Author
- Margret Riegert
Dependencies
This version declares no dependencies.
README
guard
Add Swift's guard clause as a macro to Crystal.
Installation
-
Add the dependency to your
shard.yml:dependencies: guard: github: nobodywasishere/guard -
Run
shards install
Usage
require "guard"
def normalize(value : Int32?)
guard value do
return 0
end
value
end
normalize(1) # => 1
normalize(nil) # => 0
Contributing
- Fork it (https://github.com/nobodywasishere/guard/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Margret Riegert - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Sep 30, 2023
- Crystal
1.9.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/nobodywasishere/guard.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 16, 2026
- Synced
- Aug 16, 2026
- Versions
- 1