aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-01-16 13:29:08 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-16 13:29:08 -0800
commit8f88a2841682d95c7bcce7ee76c156ec24bf82d8 (patch)
tree4d99abf0fd4d73512b116cf918e65fee47ce35e7
parent421e06f0901ec53542479ecad57a0c6f64b58a48 (diff)
downloadrails-8f88a2841682d95c7bcce7ee76c156ec24bf82d8.tar.gz
rails-8f88a2841682d95c7bcce7ee76c156ec24bf82d8.tar.bz2
rails-8f88a2841682d95c7bcce7ee76c156ec24bf82d8.zip
change sqlite3-ruby => sqlite3 in the generators
-rw-r--r--railties/lib/rails/generators/app_base.rb14
-rw-r--r--railties/lib/rails/generators/rails/app/templates/Gemfile2
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml2
-rw-r--r--railties/test/generators/app_generator_test.rb2
-rw-r--r--railties/test/generators/plugin_new_generator_test.rb2
5 files changed, 5 insertions, 17 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index 7766050632..ab7ed4eb9e 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -112,12 +112,7 @@ module Rails
end
def database_gemfile_entry
- entry = ""
- unless options[:skip_active_record]
- entry = "gem '#{gem_for_database}'"
- entry << ", :require => '#{require_for_database}'" if require_for_database
- end
- entry
+ options[:skip_active_record] ? "" : "gem '#{gem_for_database}'"
end
def rails_gemfile_entry
@@ -150,19 +145,12 @@ gem 'rails', '#{Rails::VERSION::STRING}'
case options[:database]
when "oracle" then "ruby-oci8"
when "postgresql" then "pg"
- when "sqlite3" then "sqlite3-ruby"
when "frontbase" then "ruby-frontbase"
when "mysql" then "mysql2"
else options[:database]
end
end
- def require_for_database
- case options[:database]
- when "sqlite3" then "sqlite3"
- end
- end
-
def bundle_if_dev_or_edge
bundle_command = File.basename(Thor::Util.ruby_command).sub(/ruby/, 'bundle')
run "#{bundle_command} install" if dev_or_edge?
diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile
index 322baf766f..7d5a865b80 100644
--- a/railties/lib/rails/generators/rails/app/templates/Gemfile
+++ b/railties/lib/rails/generators/rails/app/templates/Gemfile
@@ -17,7 +17,7 @@ source 'http://rubygems.org'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
-# gem 'sqlite3-ruby', :require => 'sqlite3'
+# gem 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml
index 025d62a8d8..90d87cc295 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml
+++ b/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml
@@ -1,5 +1,5 @@
# SQLite version 3.x
-# gem install sqlite3-ruby (not necessary on OS X Leopard)
+# gem install sqlite3
development:
adapter: sqlite3
database: db/development.sqlite3
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 0fe5cdc4a8..28b20d4206 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -106,7 +106,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
def test_config_database_is_added_by_default
run_generator
assert_file "config/database.yml", /sqlite3/
- assert_file "Gemfile", /^gem\s+["']sqlite3-ruby["'],\s+:require\s+=>\s+["']sqlite3["']$/
+ assert_file "Gemfile", /^gem\s+["']sqlite3["']$/
end
def test_config_another_database
diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb
index 68f33c5a20..2a8b337144 100644
--- a/railties/test/generators/plugin_new_generator_test.rb
+++ b/railties/test/generators/plugin_new_generator_test.rb
@@ -68,7 +68,7 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
def test_database_entry_is_assed_by_default_in_full_mode
run_generator([destination_root, "--full"])
assert_file "test/dummy/config/database.yml", /sqlite/
- assert_file "Gemfile", /^gem\s+["']sqlite3-ruby["'],\s+:require\s+=>\s+["']sqlite3["']$/
+ assert_file "Gemfile", /^gem\s+["']sqlite3["']$/
end
def test_config_another_database