lib/caterpillar.rb in caterpillar-1.0.7 vs lib/caterpillar.rb in caterpillar-1.2.5
- old
+ new
@@ -1,14 +1,17 @@
+# encoding: utf-8
+
+
#--
-# (c) Copyright 2008,2009 Mikael Lammentausta
+# (c) Copyright 2008-2010 Mikael Lammentausta
#
# See the file MIT-LICENSE included with the distribution for
# software license details.
#++
module Caterpillar
- VERSION='1.0.7'
+ VERSION='1.2.5'
end
this_file = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
this_dir = File.dirname(File.expand_path(this_file))
@@ -18,10 +21,16 @@
require 'find'
require 'rake'
require 'rake/tasklib'
-require File.join(this_dir,'load_rails')
+# 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.
+# Maybe this is too heavy, as some tasks do not need any Rails modules.
+require File.join(this_dir,'rails_gem_chooser')
+RailsGemChooser.__load # detects the Rails config file from RAILS_ROOT
# include all ruby files
Find.find(this_dir) do |file|
if FileTest.directory?(file)
if File.basename(file) == 'deprecated'