1 | class Log4jAdapter |
Friday, August 7, 2009
A log4j adapter for Rails
This current client application I'm working on is a mixed bag of Ruby and Java parts. All our existing logging for the older Java parts uses log4j and we wanted to unify our Rails logging with that. I spent a couple of hours putting together this adapter we now use. If you need something similar it should give you a good place to start.
Wednesday, August 5, 2009
A Scala version of Unle Bob's lazy PI sequence in Clojure
I follow Uncle Bob on twitter and I'm also currently learning Scala. When I saw his tweet about a lazily evaluated infinite PI sequence in Clojure I couldn't resist giving it a shot in Scala. Here's my result (it works!). Feedback is absolutely welcome.
1 | //Gives us the :: syntax for streams. From http://www.codecommit.com/blog/scala/infinite-lists-for-the-finitely-patient. |
Monday, August 3, 2009
Rails threadsafe! and Engines
If you're planning to use the combination of engines and threadsafe! you'll need to do some extra work. Due to a bug in Rails the engine load paths are not added to the eager_load_paths at startup time. This makes engines unavailable in threadsafe! mode.
Fortunately, working around this problem is simple. Just subclass the plugin loader like this:
And wire up your new loader in your environment.rb:
Fortunately, working around this problem is simple. Just subclass the plugin loader like this:
1 | class EagerLoader < Rails::Plugin::Loader |
And wire up your new loader in your environment.rb:
1 | #require the plugin loader |
Subscribe to:
Posts (Atom)