Permalink
Browse files

compatible with 3.0, 3.2, 4.0

  • Loading branch information...
1 parent 3a26d4a commit 5a479c8a3213128a4c95c3068b7075a70f635969 @xdite xdite committed Aug 16, 2013
Showing with 21 additions and 4 deletions.
  1. +7 −3 lib/seo_helper.rb
  2. +13 −0 lib/seo_helper/engine3.rb
  3. +1 −1 lib/seo_helper/version.rb
View
@@ -7,11 +7,15 @@ class << self
end
module Rails
- if ::Rails.version < "3.1"
- require "seo_helper/railtie"
- else
+ case ::Rails.version.to_s
+ when /^4/
require "seo_helper/engine"
+ when /^3\.[12]/
+ require "seo_helper/engine3"
+ when /^3\.[0]/
+ require "seo_helper/railtie"
end
+
end
def self.configure
View
@@ -0,0 +1,13 @@
+require "seo_helper/helper"
+
+module SeoHelper
+ class Engine3 < ::Rails::Engine
+ initializer "seo_helper.view_helpers" do
+ ActionView::Base.send :include, SeoHelper::Helper
+ end
+
+ initializer "seo_helper.controller_helpers" do
+ ActionController::Base.send :include, SeoHelper::ControllerHelper
+ end
+ end
+end
@@ -1,3 +1,3 @@
module SeoHelper
- VERSION = "1.0.1"
+ VERSION = "1.0.2"
end

0 comments on commit 5a479c8

Please sign in to comment.