Sha256: eaa2f2d60acb8e09d6ce42e50cf734368afff2bc8b25bfd7dde48aa43f789643

Contents?: true

Size: 1.56 KB

Versions: 2

Compression:

Stored size: 1.56 KB

Contents

$:.unshift(File.dirname(__FILE__)) unless
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))

module StonePath
  require 'stonepath/railtie' if defined?(Rails)
  
  # main hook into the framework.  From here, this should simply have methods that cause other includes to happen.
  def self.included(base)
  
    base.instance_eval {
  
      def stonepath_workitem(&config_block)
        require File.expand_path(File.dirname(__FILE__)) + "/stonepath/work_item.rb"
        include StonePath::WorkItem
        instance_eval &config_block if config_block
      end
    
      def stonepath_task(&config_block)
        require File.expand_path(File.dirname(__FILE__)) + "/stonepath/task.rb"
        include StonePath::SPTask
        config_block ||= StonePath::SPTask.default_config_block
        instance_eval &config_block
      end
    
      def stonepath_workbench
        require File.expand_path(File.dirname(__FILE__)) + "/stonepath/work_bench.rb"
        include StonePath::WorkBench
      end
      
      def stonepath_workowner
        require File.expand_path(File.dirname(__FILE__)) + "/stonepath/work_owner.rb"
        include StonePath::WorkOwner
      end
    }
  end
  
end

require 'rubygems'
require 'active_record'
require "stonepath/config"

# I want to move these into init.rb, but for some reason, the way rails processes the
# init.rb chokes on load.  I suspect this is an artificial issue because of the way the
# embedded test app works.
load File.expand_path( File.dirname(__FILE__)) + '/stonepath/extensions/action_view.rb'




Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stonepath-0.4.2 lib/stonepath.rb
stonepath-0.6.1 lib/stonepath.rb