lib/caterpillar.rb in caterpillar-1.0.1 vs lib/caterpillar.rb in caterpillar-1.0.5

- old
+ new

@@ -1,13 +1,14 @@ #-- # (c) Copyright 2008,2009 Mikael Lammentausta -# See the file LICENSES.txt included with the distribution for +# +# See the file MIT-LICENSE included with the distribution for # software license details. #++ module Caterpillar - VERSION='1.0.1' + VERSION='1.0.5' end this_file = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__ this_dir = File.dirname(File.expand_path(this_file)) @@ -17,41 +18,10 @@ require 'find' require 'rake' require 'rake/tasklib' -# NOTE: During normal startup (not while building the gem), -# ActiveRecord should be loaded at this point, before loading any of the models. -# However, this may conflict later when Rails' rake task activates the boot process. -# The correct versions should be loaded at this point. -# Otherwise only one version of Rails & co. rubygems should exist on the system. - -if $0[/gem$/] - rails_gem_version = nil -else - # Attempt to guess proper Rails version by reading Rails' config file - f=File.open( - File.join( - File.expand_path(RAILS_ROOT), - 'config', - 'environment.rb' - ) - ) - config = f.read - rails_gem_version = config[/RAILS_GEM_VERSION.*(\d\.\d\.\d)/,1] - f.close -end - -# Load the proper versions of Rails etc. -# Not tested on all setups. -require 'rubygems' -['activesupport', -'actionpack', -'activerecord'].each { |rg| - gem(rg, '= '+rails_gem_version) if rails_gem_version - require rg -} -require 'action_controller' +require File.join(this_dir,'load_rails') # include all ruby files Find.find(this_dir) do |file| if FileTest.directory?(file) if File.basename(file) == 'deprecated'