glassy-kernel
Version, currently master branch1 version
- master branchlatestOct 12, 2020
github.com/glassy-framework/glassy-kernel
DI (Dependency Injection) Container for the Glassy Framework
3 stars
2 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
glassy-kernel:
github: glassy-framework/glassy-kernel
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.35.1- License
- MIT
- Author
- Anderson Danilo
Dependencies
This version declares no dependencies.
README
glassy-kernel
DI (Dependency Injection) Container for the Glassy Framework, based in bundles.
Inspired by: phoopy
Installation
-
Add the dependency to your
shard.yml:dependencies: glassy-kernel: github: glassy-framework/glassy-kernel -
Run
shards install
Usage
Create a dependency file, ex: config/services.yml
services:
my_object:
class: MyClass
kwargs:
logger: '@logger'
tag:
- my_tag_example
logger:
class: MyLogger
Implement these classes as you like. After that you can implement the container as below.
require "glassy-kernel"
class AppBundle < Glassy::Kernel::Bundle
SERVICES_PATH = "#{__DIR__}/config/services.yml"
end
class AppKernel < Glassy::Kernel::Kernel
register_bundles [
AppBundle
]
end
kernel = AppKernel.new
kernel.container.my_object.say_hello
Development
Always run crystal spec to execute the tests
Contributing
- Fork it (https://github.com/glassy-framework/glassy-kernel/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
- Anderson Danilo - 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
master- Seen
- Oct 12, 2020
- Crystal
0.35.1- Indexed
- yes
Dependents
Repository
github.com/glassy-framework/glassy-kernel
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1