smack

Hi. This is dependency injection for the rest of us. See smack_test.rb for examples.

FAQ

Q: COOL IS THIS LIKE ONE OF THOSE JAVA DI FRAMEWORKS?

A: No. This is an entire 12 lines of dumb code.

Q: WHY ARE YOU DOING DI IN RUBY ARE YOU A MANIAC?

A: DI is a fine pattern and is sometimes necessary. It’s just simpler to do in Ruby, hence the 15 lines of code. This just gives you nice syntax for it.

Q: SHOULD I USE THIS IN PRODUCTION CODE?

A: It’s mostly a joke so probably not.

Q: WHY ARE ALL YOUR PROJECT NAMES SO TERRIBLE?

A: Marketing isn’t really my strong point.

Copyright © 2009 ggironda. See LICENSE for details.