lib/gravatarify.rb in gravatarify-2.2.1 vs lib/gravatarify.rb in gravatarify-2.2.2

- old
+ new

@@ -2,16 +2,17 @@ require 'gravatarify/utils' require 'gravatarify/helper' module Gravatarify # current API version, as defined by http://semver.org/ - VERSION = "2.2.1".freeze + VERSION = "2.2.2".freeze end if defined?(ActiveSupport) && ActiveSupport.respond_to?(:on_load) # Support for rails 3 ActiveSupport.on_load(:action_view) { include Gravatarify::Helper } -else - # try to hook into HAML and ActionView - Haml::Helpers.send(:include, Gravatarify::Helper) if defined?(Haml) +elsif defined?(ActionView) + # hook into rails 2.x ActionView::Base.send(:include, Gravatarify::Helper) if defined?(ActionView) end +# try to include it in HAML too, no matter what :) +Haml::Helpers.send(:include, Gravatarify::Helper) if defined?(Haml)