Permalink
Browse files

clean up the jruby part - need only sqlite3

  • Loading branch information...
1 parent 7b1b164 commit 03f2959c6a69d226405951e887c2818952f1adb7 @mkristian committed Mar 21, 2011
Showing with 5 additions and 19 deletions.
  1. +5 −19 templates/jruby.template
View
@@ -1,31 +1,17 @@
#-*- mode: ruby -*-
-# this is tailered to rails 3.0.1 (and maybe others)
-
-db_gem_line = "gem '#{gem_for_database}'"
-db_gem_line << ", :require => '#{require_for_database}'" if require_for_database
+db_gem_line = "gem '#{gem_for_database}', :require => 'sqlite3'"
db_gem_regexp = Regexp::quote(db_gem_line).gsub("'", "['\"]")
-jdbc_db = case options[:database]
- when /postgresql/
- "postgres"
- when /mysql2/
- "mysql"
- when /mysql|sqlite3/
- options[:database]
- end
-jdbc_gem_line = "\n gem 'jdbc-#{jdbc_db}', :require => false" if jdbc_db
+
+jdbc_gem_line = "gem 'jdbc-sqlite3', :require => false"
gsub_file "Gemfile", /^#{db_gem_regexp}\w*$/, <<DB
if defined?(JRUBY_VERSION)
- gem 'activerecord-jdbc-adapter'#{jdbc_gem_line}
+ gem 'activerecord-jdbc-adapter'
+ #{jdbc_gem_line}
else
#{db_gem_line}
end
DB
-# Avoid MySQL2 option for Rails 3
-if options[:database] =~ /mysql/
- gsub_file "config/database.yml", /mysql2/, 'mysql'
-end
-
# vim: syntax=Ruby

0 comments on commit 03f2959

Please sign in to comment.