ruhoh/ruhoh.rb — pull request #77 by MrWerewolf (2012-08-13 15:05:36+00:00)
Title: Conditionally require the psych gem.  It's included in ruby 1.9.2 or better.

The **psych** library [ships with Ruby 1.9.2 or greater](http://www.ruby-lang.org/en/news/2010/08/18/ruby-1-9.2-released/). Unfortunately, it seems there is no way to conditionally add a dependency to `ruhoh.gemspec`, so this solution attempts a compromise by removing the dependency in the **gemspec** and adding the conditional dependency for bundler's **Gemfile**. This means users with ruby 1.8.x will be prompted to manually install *psych* when they run *ruhoh* for the first time. I got the idea from [this article](http://blog.mattwynne.net/2011/04/26/targeting-multiple-platforms-jruby-etc-with-a-rubygems-gemspec/).

What motivates me to do this is to resolve #54 (at least partially). The latest 1.9.x RubyInstaller includes **psych**, so Windows users with a recent version of ruby will be able to install and run *ruhoh* without going through the trouble of hacking the **psych** gem in order to install it.