GitXplorerGitXplorer
j

dejector

public
9 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
ab19c62ca06bfcba3450e70ed9d80cc62d2e52a5

Update package description

jjstasiak committed 11 years ago
Unverified
8db0b50411fe3a17a0e2c6710db5baae306db1fc

Update README.rst

jjstasiak committed 11 years ago
Unverified
44d26f3002de9e127a975a15c9d1e177c42f38c1

Update README.rst

jjstasiak committed 11 years ago
Unverified
d81c76d179c7b806d42d624d646e539c467c3833

Fix Travis build

jjstasiak committed 11 years ago
Unverified
1cecba139e00edbfdfad5514c0560cfc3cdc5163

Upgraded to dunit>=1.0.8

oo3o committed 11 years ago
Unverified
bb7b3cad92495cc67e77b6caee12d00c65f59e2b

Introduce Module concept

jjstasiak committed 11 years ago

README

The README file for this repository.

dejector

.. image:: https://travis-ci.org/jstasiak/dejector.png?branch=master :alt: Build status :target: https://travis-ci.org/jstasiak/dejector

This is a proof of concept of dependency injection framework for D and my way of learning the language.

Example usage

.. code-block:: d

import std.conv : to;
import std.stdio : writefln;

import dejector : Dejector;

interface Greeter {
    string greet();
}

class GreeterImplementation : Greeter {
    string greet() { return "Hello!"; }
}

void main() {
    Dejector dejector;
    dejector.bind!(Greeter, GreeterImplementation);
    auto greeter = dejector.get!Greeter;
    writefln(greeter.greet)
}

Output::

Hello!

Running tests

You need to have dub <https://github.com/rejectedsoftware/dub>_ >= 0.9.21 installed and reacheble from your PATH.

::

dub --verbose test

Copyright

Copyright (C) 2013 Jakub Stasiak

This source code is licensed under MIT license, see LICENSE file for details.