diff options
| author | hukl <contact@smyck.org> | 2009-02-17 12:47:49 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-02-17 12:47:49 +0100 |
| commit | 3cdcb5ca02a94b2b342c30903a27d47d35d46e55 (patch) | |
| tree | ef3e1154fe262561b3955c07edcaee3824a21f47 /vendor/plugins/will_paginate/test/boot.rb | |
| parent | 7a282f2605f6fb3689940e5c7072b4801653deb2 (diff) | |
added will_paginate plugin
Diffstat (limited to 'vendor/plugins/will_paginate/test/boot.rb')
| -rw-r--r-- | vendor/plugins/will_paginate/test/boot.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/plugins/will_paginate/test/boot.rb b/vendor/plugins/will_paginate/test/boot.rb new file mode 100644 index 0000000..622fc93 --- /dev/null +++ b/vendor/plugins/will_paginate/test/boot.rb | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | plugin_root = File.join(File.dirname(__FILE__), '..') | ||
| 2 | version = ENV['RAILS_VERSION'] | ||
| 3 | version = nil if version and version == "" | ||
| 4 | |||
| 5 | # first look for a symlink to a copy of the framework | ||
| 6 | if !version and framework_root = ["#{plugin_root}/rails", "#{plugin_root}/../../rails"].find { |p| File.directory? p } | ||
| 7 | puts "found framework root: #{framework_root}" | ||
| 8 | # this allows for a plugin to be tested outside of an app and without Rails gems | ||
| 9 | $:.unshift "#{framework_root}/activesupport/lib", "#{framework_root}/activerecord/lib", "#{framework_root}/actionpack/lib" | ||
| 10 | else | ||
| 11 | # simply use installed gems if available | ||
| 12 | puts "using Rails#{version ? ' ' + version : nil} gems" | ||
| 13 | require 'rubygems' | ||
| 14 | |||
| 15 | if version | ||
| 16 | gem 'rails', version | ||
| 17 | else | ||
| 18 | gem 'actionpack' | ||
| 19 | gem 'activerecord' | ||
| 20 | end | ||
| 21 | end | ||
