Permalink
Browse files

Add railtie

  • Loading branch information...
1 parent 2d5f65a commit dda66620e07dfc57ed58beb095861ee9ec7d2e13 Bruce Williams committed Sep 10, 2010
Showing with 37 additions and 3 deletions.
  1. +7 −1 README.md
  2. +11 −1 lib/ie_conditional_tag.rb
  3. +19 −0 lib/ie_conditional_tag/railtie.rb
  4. +0 −1 rails/init.rb
View
@@ -72,7 +72,13 @@ call it, eg:
Installation
------------
-Install as a gem plugin, or directly in `vendor/plugins`.
+Use bundler. In your `Gemfile`:
+
+ gem 'ie_conditional_tag'
+
+Install it:
+
+ $ bundler install
Then, run the following:
View
@@ -1,5 +1,15 @@
-module IEConditionalTag
+require 'ie_conditional_tag/configuration'
+require 'ie_conditional_tag/dsl'
+require 'ie_conditional_tag/helper'
+
+require 'ie_conditional_tag/condition'
+require 'ie_conditional_tag/protected_condition'
+require 'ie_conditional_tag/unprotected_condition'
+
+require 'ie_conditional_tag/railtie'
+module IEConditionalTag
+
def self.config
@config ||= Configuration.new
end
@@ -0,0 +1,19 @@
+module IEConditionalTag
+
+ if defined?(Rails::Railtie)
+ require 'rails'
+ class Railtie < Rails::Railtie
+ initializer 'ie_conditional_tag.insert_into_active_record' do
+ ActiveSupport.on_load :action_pack do
+ IEConditionalTag::Railtie.insert
+ end
+ end
+ end
+ end
+
+ class Railtie
+ def self.insert
+ ActionController::Base.helper(IEConditionalTag::Helper)
+ end
+ end
+end
View
@@ -1 +0,0 @@
-ActionController::Base.helper(IEConditionalTag::Helper)

0 comments on commit dda6662

Please sign in to comment.