Permalink
Browse files

Adding a script, `prerelease`, to test against various versions of Ru…

…by and AR.

Ripped off from the active_hash project. (Nods to Jeff Dean.)
  • Loading branch information...
1 parent 18bb0ec commit cfecf342906046633680a19520925cecefc1ec88 @flavorjones flavorjones committed Sep 20, 2011
Showing with 51 additions and 33 deletions.
  1. +0 −1 .gitignore
  2. +20 −0 Gemfile
  3. +0 −8 Gemfile-2.2
  4. +0 −8 Gemfile-2.3
  5. +0 −8 Gemfile-3.0
  6. +0 −8 Gemfile-3.1
  7. +31 −0 prerelease
View
@@ -1,3 +1,2 @@
-Gemfile
Gemfile*.lock
.bundle
View
20 Gemfile
@@ -0,0 +1,20 @@
+source :gemcutter
+
+activerecord_version = ENV['ACTS_AS_FU_ACTIVERECORD_VERSION']
+
+if activerecord_version == "edge"
+ git "https://github.com/rails/rails.git" do
+ gem "activerecord"
+ gem "activesupport"
+ end
+elsif activerecord_version && activerecord_version.strip != ""
+ gem "activerecord", activerecord_version
+else
+ gem "activerecord"
+end
+
+gem "sqlite3-ruby"
+
+group :development do
+ gem "rspec", "~>1"
+end
View
@@ -1,8 +0,0 @@
-source :gemcutter
-
-gem "activerecord", "2.2.3"
-gem "sqlite3-ruby"
-
-group :development do
- gem "rspec", "~>1"
-end
View
@@ -1,8 +0,0 @@
-source :gemcutter
-
-gem "activerecord", "2.3.8"
-gem "sqlite3-ruby"
-
-group :development do
- gem "rspec", "~>1"
-end
View
@@ -1,8 +0,0 @@
-source :gemcutter
-
-gem "activerecord", "3.0.0"
-gem "sqlite3-ruby"
-
-group :development do
- gem "rspec", "~>1"
-end
View
@@ -1,8 +0,0 @@
-source :gemcutter
-
-gem "activerecord", "3.1.0"
-gem "sqlite3-ruby"
-
-group :development do
- gem "rspec", "~>1"
-end
View
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+# Load RVM into a shell session *as a function*
+if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
+ # First try to load from a user install
+ source "$HOME/.rvm/scripts/rvm"
+elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
+ # Then try to load from a root install
+ source "/usr/local/rvm/scripts/rvm"
+else
+ printf "ERROR: An RVM installation was not found.\n"
+fi
+
+set -e
+
+function run {
+ gem list --local bundler | grep bundler || gem install bundler --no-ri --no-rdoc
+
+ for v in 2.3.11 3.0.10 3.1.0 "" ; do
+ ACTS_AS_FU_ACTIVERECORD_VERSION=${v} bundle --quiet update --local activerecord || ACTS_AS_FU_ACTIVERECORD_VERSION=${v} bundle --quiet update activerecord
+ echo "Running $(ruby -v) against $(basename $(bundle show activerecord)) ..."
+ bundle exec spec spec
+ done
+}
+
+for v in ruby-1.8.7 ree-1.8.7 ruby-1.9.2 ; do
+ rvm use ${v}@acts_as_fu --create
+ run
+done
+
+echo 'Success!'

0 comments on commit cfecf34

Please sign in to comment.