Refs #2: replaced __dir__ for Ruby 1.8 compatibility.