diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-07-08 01:22:48 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-07-08 01:22:48 +0000 |
commit | 0d339345426436338b969fb7a22a2517921d7d73 (patch) | |
tree | 6a98f65dabfb5b2d65162881b66c208dcf9806cc | |
parent | 80b5331c0f2eba19e53b5c9bc8e9b3e5faffc499 (diff) | |
download | rails-0d339345426436338b969fb7a22a2517921d7d73.tar.gz rails-0d339345426436338b969fb7a22a2517921d7d73.tar.bz2 rails-0d339345426436338b969fb7a22a2517921d7d73.zip |
rails -d frontbase to create a new project with a frontbase database.yml. Closes #4945.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4587 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/configs/databases/frontbase.yml | 28 | ||||
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/app_generator.rb | 12 |
3 files changed, 36 insertions, 6 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 88ec145f83..8856530b6e 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* rails -d frontbase to create a new project with a frontbase database.yml. #4945 [mlaster@metavillage.com] + * Ensure the logger is initialized. #5629 [mike@clarkware.com] * Added Mongrel-spawning capabilities to script/process/spawner. Mongrel will be the default choice if installed, otherwise FCGI is tried [DHH]. Examples: diff --git a/railties/configs/databases/frontbase.yml b/railties/configs/databases/frontbase.yml new file mode 100644 index 0000000000..2eed3133a1 --- /dev/null +++ b/railties/configs/databases/frontbase.yml @@ -0,0 +1,28 @@ +# FrontBase versions 4.x +# +# Get the bindings: +# gem install ruby-frontbase + +development: + adapter: frontbase + host: localhost + database: <%= app_name %>_development + username: <%= app_name %> + password: '' + +# Warning: The database defined as 'test' will be erased and +# re-generated from your development database when you run 'rake'. +# Do not set this db to the same as development or production. +test: + adapter: frontbase + host: localhost + database: <%= app_name %>_test + username: <%= app_name %> + password: '' + +production: + adapter: frontbase + host: localhost + database: <%= app_name %>_production + username: <%= app_name %> + password: '' diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb index bbdd3cb206..584aa0cda3 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -3,9 +3,9 @@ require 'rbconfig' class AppGenerator < Rails::Generator::Base DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']) - - DATABASES = %w( mysql oracle postgresql sqlite2 sqlite3 ) - + + DATABASES = %w(mysql oracle postgresql sqlite2 sqlite3 frontbase) + default_options :db => "mysql", :shebang => DEFAULT_SHEBANG, :freeze => false mandatory_options :source => "#{File.dirname(__FILE__)}/../../../../.." @@ -65,7 +65,7 @@ class AppGenerator < Rails::Generator::Base %w(404 500 index).each do |file| m.template "html/#{file}.html", "public/#{file}.html" end - + m.template "html/favicon.ico", "public/favicon.ico" m.template "html/robots.txt", "public/robots.txt" m.file "html/images/rails.png", "public/images/rails.png" @@ -103,11 +103,11 @@ class AppGenerator < Rails::Generator::Base "Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3).", "Default: mysql") { |v| options[:db] = v } - opt.on("-f", "--freeze", + opt.on("-f", "--freeze", "Freeze Rails in vendor/rails from the gems generating the skeleton", "Default: false") { |v| options[:freeze] = v } end - + def mysql_socket_location RUBY_PLATFORM =~ /mswin32/ ? MYSQL_SOCKET_LOCATIONS.find { |f| File.exists?(f) } : nil end |