Skip to content

Latest commit

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

glassy-kernel

CircleCI

DI (Dependency Injection) Container for the Glassy Framework, based in bundles.

Inspired by: phoopy

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
    glassy-kernel:
    github: glassy-framework/glassy-kernel
  2. Run shards install

Usage

Create a dependency file, ex: config/services.yml

services:
my_object:
class: MyClasskwargs:
logger: '@logger'tag:
- my_tag_examplelogger:
class: MyLogger

Implement these classes as you like. After that you can implement the container as below.

require"glassy-kernel"classAppBundle < Glassy::Kernel::BundleSERVICES_PATH="#{__DIR__}/config/services.yml"endclassAppKernel < 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

  1. Fork it (https://github.com/glassy-framework/glassy-kernel/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

About

DI (Dependency Injection) Container for the Glassy Framework

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages