crygen
Version, currently 1.3.014 versions
- 1.3.0latestDec 30, 2025
- 1.2.2not indexedDec 30, 2025
- 1.2.1not indexedDec 30, 2025
- 1.2.0not indexedDec 30, 2025
- 1.1.0not indexedDec 30, 2025
- 1.0.0not indexedDec 30, 2025
- 0.6.0not indexedDec 30, 2025
- 0.5.1not indexedDec 30, 2025
- 0.5.0not indexedDec 30, 2025
- 0.4.0not indexedDec 30, 2025
- 0.3.1not indexedDec 30, 2025
- 0.3.0not indexedDec 30, 2025
- 0.2.0not indexedDec 30, 2025
- 0.1.0not indexedDec 30, 2025
github.com/tamdaz/crygen
A library that allows to generate the Crystal code
13 stars
1 dependent
License: MIT
Installation
# Add this to your shard.yml
dependencies:
crygen:
github: tamdaz/crygen
version: ~> 1.3.0Then run:
shards installshard.yml
- Crystal
>= 1.16.0- License
- MIT
- Author
- tamdaz
- Target
consolefrom src/console.cr
Dependencies
This version declares no dependencies.
README
crygen
crygen is a library that allows to generate a Crystal file. It is inspired by the PHP library : nette/php-generator.
- Crygen documentation: https://tamdaz.github.io/crygen/
- API documentation: https://crystaldoc.info/github/tamdaz/crygen/main/index.html
Installation
- Add the dependency to your
shard.yml:
dependencies:
crygen:
github: tamdaz/crygen
version: ~> 1.3.0
-
Run
shards install -
Finally, import
crygenfrom the entrypoint file:
require "crygen"
module App
VERSION = "1.0.0"
class_type = CGT::Class.new("MyClass")
method_type = CGT::Method.new("my_method", "String")
class_type.add_method(method_type)
puts class_type.generate
# or
puts class_type
# Output:
# class MyClass
# def my_method : String
# end
# end
# You can save the generated code into the .cr file.
File.write("src/classes/my_class.cr", class_type)
end
Contributing
- Fork it (https://github.com/tamdaz/crygen/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
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.3.0- Tagged
- Dec 30, 2025
- Commit
97f0f4da267e- Crystal
>= 1.16.0- Indexed
- yes
Dependents
Repository
github.com/tamdaz/crygen
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 17, 2026
- Synced
- Aug 17, 2026
- Versions
- 14