Sha256: 4ca1913d6e45f95903ab557c0b18824883f6697d4ec5b7c3bf9263d380f026ad

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

$:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
require 'kung_figure'
require 'active_support'

module Depo
  VERSION = '0.0.8'
  autoload :Config, 'depo/config'
  autoload :Build, 'depo/build'
  autoload :DijitConventions, 'depo/dijit_conventions'
  autoload :ViewHelpers, 'depo/view_helpers'
  include KungFigure
  class << self
    alias_method :old_configure, :configure
    def configure(&block)
      old_configure(&block)
      dojofy if Depo.config.enable_dojofy 
    end
    def dojofy
      Dir.chdir(RAILS_ROOT) do 
        require 'dojo_src'
        version = DojoSrc::VERSION
        #version = Depo.config.dojo_version
        system "dojofy _#{version}_ #{Depo.config.src_path}"
      end
    end
    def enable
      return if ActionView::Base.instance_methods.include? 'dojo'
      if defined?(ActionController::Base) 
        ActionView::Base.send :include, ViewHelpers
      end
    end
  end
end

if defined?(Rails) and defined?(ActionView)
  Depo.enable
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
depo-0.0.8 lib/depo.rb