Title: [788] tags/activerecord-jdbc/release-0.6/drivers: Don' t try to load JDBC driver jars if not running in JRuby

Diff

Modified: tags/activerecord-jdbc/release-0.6/drivers/derby/lib/jdbc/derby.rb (787 => 788)


--- tags/activerecord-jdbc/release-0.6/drivers/derby/lib/jdbc/derby.rb	2007-11-05 21:46:15 UTC (rev 787)
+++ tags/activerecord-jdbc/release-0.6/drivers/derby/lib/jdbc/derby.rb	2007-11-05 21:53:03 UTC (rev 788)
@@ -4,4 +4,8 @@
   end
 end
 
-require "derby-#{Jdbc::Derby::VERSION}.jar"
\ No newline at end of file
+if RUBY_PLATFORM =~ /java/
+  require "derby-#{Jdbc::Derby::VERSION}.jar"
+else
+  warn "jdbc-derby is only for use with JRuby"
+end
\ No newline at end of file

Modified: tags/activerecord-jdbc/release-0.6/drivers/hsqldb/lib/jdbc/hsqldb.rb (787 => 788)


--- tags/activerecord-jdbc/release-0.6/drivers/hsqldb/lib/jdbc/hsqldb.rb	2007-11-05 21:46:15 UTC (rev 787)
+++ tags/activerecord-jdbc/release-0.6/drivers/hsqldb/lib/jdbc/hsqldb.rb	2007-11-05 21:53:03 UTC (rev 788)
@@ -3,4 +3,8 @@
     VERSION = "1.8.0.7"
   end
 end
-require "hsqldb-#{Jdbc::HSQLDB::VERSION}.jar"
\ No newline at end of file
+if RUBY_PLATFORM =~ /java/
+  require "hsqldb-#{Jdbc::HSQLDB::VERSION}.jar"
+else
+  warn "jdbc-hsqldb is only for use with JRuby"
+end
\ No newline at end of file

Modified: tags/activerecord-jdbc/release-0.6/drivers/mysql/lib/jdbc/mysql.rb (787 => 788)


--- tags/activerecord-jdbc/release-0.6/drivers/mysql/lib/jdbc/mysql.rb	2007-11-05 21:46:15 UTC (rev 787)
+++ tags/activerecord-jdbc/release-0.6/drivers/mysql/lib/jdbc/mysql.rb	2007-11-05 21:53:03 UTC (rev 788)
@@ -3,4 +3,8 @@
     VERSION = "5.0.4"
   end
 end
-require "mysql-connector-java-#{Jdbc::MySQL::VERSION}-bin.jar"
\ No newline at end of file
+if RUBY_PLATFORM =~ /java/
+  require "mysql-connector-java-#{Jdbc::MySQL::VERSION}-bin.jar"
+else
+  warn "jdbc-mysql is only for use with JRuby"
+end
\ No newline at end of file

Modified: tags/activerecord-jdbc/release-0.6/drivers/postgres/lib/jdbc/postgres.rb (787 => 788)


--- tags/activerecord-jdbc/release-0.6/drivers/postgres/lib/jdbc/postgres.rb	2007-11-05 21:46:15 UTC (rev 787)
+++ tags/activerecord-jdbc/release-0.6/drivers/postgres/lib/jdbc/postgres.rb	2007-11-05 21:53:03 UTC (rev 788)
@@ -3,4 +3,8 @@
     VERSION = "8.2" 
   end
 end
-require "postgresql-#{Jdbc::Postgres::VERSION}-504.jdbc3.jar"
\ No newline at end of file
+if RUBY_PLATFORM =~ /java/
+  require "postgresql-#{Jdbc::Postgres::VERSION}-504.jdbc3.jar"
+else
+  warn "jdbc-postgres is only for use with JRuby"
+end
\ No newline at end of file
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to