diff options
author | Marcel Molina <marcel@vernix.org> | 2006-04-27 22:39:45 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2006-04-27 22:39:45 +0000 |
commit | b2c0ddf033fbf143539ad8a7630747a0e866e4fc (patch) | |
tree | 2aae48e00aa7d4951e711ebb667d8f37e0c8a6d0 /activerecord/Rakefile | |
parent | dd5397a57c39da78f22e0fec517ff6e5ede7628a (diff) | |
download | rails-b2c0ddf033fbf143539ad8a7630747a0e866e4fc.tar.gz rails-b2c0ddf033fbf143539ad8a7630747a0e866e4fc.tar.bz2 rails-b2c0ddf033fbf143539ad8a7630747a0e866e4fc.zip |
Add support for FrontBase (http://www.frontbase.com/) with a new adapter thanks to the hard work of one Mike Laster. Closes #4093. [mlaster@metavillage.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4291 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/Rakefile')
-rwxr-xr-x | activerecord/Rakefile | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/activerecord/Rakefile b/activerecord/Rakefile index 129cdd8a7f..623dd5aaa5 100755 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -27,7 +27,7 @@ task :default => [ :test_mysql, :test_sqlite, :test_postgresql ] # Run the unit tests -for adapter in %w( mysql postgresql sqlite sqlite3 firebird sqlserver sqlserver_odbc db2 oracle sybase openbase ) +for adapter in %w( mysql postgresql sqlite sqlite3 firebird sqlserver sqlserver_odbc db2 oracle sybase openbase frontbase ) Rake::TestTask.new("test_#{adapter}") { |t| t.libs << "test" << "test/connections/native_#{adapter}" t.pattern = "test/*_test{,_#{adapter}}.rb" @@ -71,6 +71,45 @@ end desc 'Rebuild the PostgreSQL test databases' task :rebuild_postgresql_databases => [:drop_postgresql_databases, :build_postgresql_databases] +desc 'Build the FrontBase test databases' +task :build_frontbase_databases => :rebuild_frontbase_databases + +desc 'Rebuild the FrontBase test databases' +task :rebuild_frontbase_databases do + build_frontbase_database = Proc.new do |db_name, sql_definition_file| + %( + STOP DATABASE #{db_name}; + DELETE DATABASE #{db_name}; + CREATE DATABASE #{db_name}; + + CONNECT TO #{db_name} AS SESSION_NAME USER _SYSTEM; + SET COMMIT FALSE; + + CREATE USER RAILS; + CREATE SCHEMA RAILS AUTHORIZATION RAILS; + COMMIT; + + SET SESSION AUTHORIZATION RAILS; + SCRIPT '#{sql_definition_file}'; + + COMMIT; + + DISCONNECT ALL; + ) + end + create_activerecord_unittest = build_frontbase_database['activerecord_unittest', File.join(SCHEMA_PATH, 'frontbase.sql')] + create_activerecord_unittest2 = build_frontbase_database['activerecord_unittest2', File.join(SCHEMA_PATH, 'frontbase2.sql')] + execute_frontbase_sql = Proc.new do |sql| + system(<<-SHELL) + /Library/FrontBase/bin/sql92 <<-SQL + #{sql} + SQL + SHELL + end + execute_frontbase_sql[create_activerecord_unittest] + execute_frontbase_sql[create_activerecord_unittest2] +end + # Generate the RDoc documentation Rake::RDocTask.new { |rdoc| |