All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rails-templates.activerecord.rb Maven / Gradle / Ivy

There is a newer version: 3.0.5
Show newest version
db_gem_line = "gem '#{gem_for_database}'"
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 = jdbc_db != 'sqlite3' ? "\n  gem 'jdbc-#{jdbc_db}', :require => false" : < false

  # Derby JDBC adapter
  #gem 'activerecord-jdbcderby-adapter'

  # HSQL JDBC adapter
  #gem 'activerecord-jdbchsqldb-adapter'

  # H2 JDBC adapter
  #gem 'activerecord-jdbch2-adapter'

  # SQL Server JDBC adapter
  #gem 'activerecord-jdbcmssql-adapter'
JDBC

if Rails::VERSION::MINOR > 0
  rhino_gem_line = <
#  password: 
#  hostname: localhost
#  database: dummy

# If you are using oracle, db2, sybase, informix or prefer to use the plain
# JDBC adapter, configure your database setting as the example below (requires
# you to download and manually install the database vendor's JDBC driver .jar
# file). See your driver documentation for the apropriate driver class and
# connection string:
#
#development:
#  adapter: jdbc
#  username: 
#  password: 
#  driver: com.ibm.db2.jcc.DB2Driver
#  url: jdbc:db2://localhost:5021/dummy

COMMENTS

temp = IO.read(file)

open(file, "w") { |f| f << comment << temp }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy