From 3cdcb5ca02a94b2b342c30903a27d47d35d46e55 Mon Sep 17 00:00:00 2001 From: hukl Date: Tue, 17 Feb 2009 12:47:49 +0100 Subject: added will_paginate plugin --- vendor/plugins/will_paginate/test/boot.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 vendor/plugins/will_paginate/test/boot.rb (limited to 'vendor/plugins/will_paginate/test/boot.rb') diff --git a/vendor/plugins/will_paginate/test/boot.rb b/vendor/plugins/will_paginate/test/boot.rb new file mode 100644 index 00000000..622fc93c --- /dev/null +++ b/vendor/plugins/will_paginate/test/boot.rb @@ -0,0 +1,21 @@ +plugin_root = File.join(File.dirname(__FILE__), '..') +version = ENV['RAILS_VERSION'] +version = nil if version and version == "" + +# first look for a symlink to a copy of the framework +if !version and framework_root = ["#{plugin_root}/rails", "#{plugin_root}/../../rails"].find { |p| File.directory? p } + puts "found framework root: #{framework_root}" + # this allows for a plugin to be tested outside of an app and without Rails gems + $:.unshift "#{framework_root}/activesupport/lib", "#{framework_root}/activerecord/lib", "#{framework_root}/actionpack/lib" +else + # simply use installed gems if available + puts "using Rails#{version ? ' ' + version : nil} gems" + require 'rubygems' + + if version + gem 'rails', version + else + gem 'actionpack' + gem 'activerecord' + end +end -- cgit v1.3