Title: [759] trunk/activerecord-jdbc/lib/jdbc_adapter.rb: Make jdbc_databases.rake automatically installed in a Rails application
Revision
759
Author
olabini
Date
2007-10-01 04:56:56 -0400 (Mon, 01 Oct 2007)

Log Message

Make jdbc_databases.rake automatically installed in a Rails application

Modified Paths

Diff

Modified: trunk/activerecord-jdbc/lib/jdbc_adapter.rb (758 => 759)


--- trunk/activerecord-jdbc/lib/jdbc_adapter.rb	2007-09-27 12:41:45 UTC (rev 758)
+++ trunk/activerecord-jdbc/lib/jdbc_adapter.rb	2007-10-01 08:56:56 UTC (rev 759)
@@ -19,6 +19,14 @@
       require 'active_record/connection_adapters/jdbc_adapter'
     end
   end
+  if defined?(RAILS_ROOT)
+    to_file = File.expand_path(File.join(RAILS_ROOT, 'lib', 'tasks', 'jdbc_databases.rake'))
+    from_file = File.expand_path(File.join(__FILE__, 'tasks', 'jdbc_databases.rake'))
+    if !File.exists(to_file) || (File.mtime(to_file) < File.mtime(from_file))
+      require 'fileutils'
+      FileUtils.cp from_file, to_file, :verbose => true
+    end
+  end
 else
   warn "ActiveRecord-JDBC is for use with JRuby only"
 end
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to