Sha256: f6175a48177d16deff7af6b181d749b7d30b55470d1b7213f51b0a33ae025887

Contents?: true

Size: 878 Bytes

Versions: 3

Compression:

Stored size: 878 Bytes

Contents

module GreenMonkey
  if defined? Rails
    require 'green_monkey/railtie'
  else
    require "green_monkey/ext/mida"
    require "green_monkey/ext/haml" if defined? Haml

    if defined? ActiveModel
      require "green_monkey/ext/active_model"
      ActiveModel::Dirty.send :include, GreenMonkey::ModelHelpers
    end

    if defined? ActiveRecord
      require "green_monkey/ext/active_model"
      ActiveRecord::Base.send :include, GreenMonkey::ModelHelpers
    end


    if defined? ActionView
      require "green_monkey/ext/action_view"
      require 'green_monkey/ext/view_helper'
      ActionView::Base.send :include, GreenMonkey::ViewHelper
    end
  end

  if defined?(Sinatra)
    require 'green_monkey/ext/view_helper'
    Sinatra.helpers do
      include ActionView::Helpers::TagHelper if defined?(ActionView)
      include GreenMonkey::ViewHelper
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
green_monkey-0.3.0 lib/green_monkey.rb
green_monkey-0.2.2 lib/green_monkey.rb
green_monkey-0.1.4 lib/green_monkey.rb