Needle Dependency Injection Container
Needle is a Dependency Injection container, similar in goal to HiveMind, Spring, and PicoContainer (in the Java universe), but vastly different in implementation. It takes advantage of the dynamic features in Ruby, especially closures and instance_eval.
- Project page: rubyforge.org/projects/needle
- User Manual: needle.rubyforge.org
- API Documentation: needle.rubyforge.org/api
- Needle Wiki: needle.rubyforge.org/wiki/wiki.pl
For an excellent overview of dependency injection, have a look at "Dependency Injection in Ruby" (files/doc/di-in-ruby_rdoc.html).
Assuming you have RubyGems installed, all you have to do is:
gem --remote-install needle
This will install the latest version of Needle.
Or, if you want a little more control over the installation:
ruby setup.rb --help
This will show you the options that are available to you, and then you can do each stage of the installation manually:
ruby setup.rb config ruby setup.rb setup ruby setup.rb install
Thanks go to:
- Matz, for creating Ruby in the first place.
- Jim Weirich, for his inspirational blog article "Dependency Injection in Ruby" (onestepback.org/index.cgi/Tech/Ruby/DependencyInjectionInRuby.rdoc) that formed the embryo of what Needle has eventually become.
Needle is copyright © 2004 Jamis Buck. It is open-source software, and may be redistributed under the terms of the BSD or Ruby licenses. The texts of these licences are included in the Needle distribution, under the doc subdirectory.
The Needle manual and all software used to build it are distributed under the Attribution-ShareAlike 1.0 Creative Commons license. Distribute it and modify it all you want, but give me credit and distribute your changes under an identical license.