diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-10-16 13:47:34 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-10-16 13:47:34 +0000 |
commit | 6273753a42cde0a4d52eb276ed066749cb11523b (patch) | |
tree | a4bd62b5649e1ea32fa4008280343afb0ebd4d5b /railties/lib/rails_generator | |
parent | 4c4651ad000789a1661ab4dd16368ebce522cc04 (diff) | |
download | rails-6273753a42cde0a4d52eb276ed066749cb11523b.tar.gz rails-6273753a42cde0a4d52eb276ed066749cb11523b.tar.bz2 rails-6273753a42cde0a4d52eb276ed066749cb11523b.zip |
Try to figure out which mysql socket to use. Default to /path/to/your/mysql.sock
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2645 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/app_generator.rb | 7 |
1 files changed, 6 insertions, 1 deletions
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 f21d2fb6d7..f15fd3754e 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -11,6 +11,8 @@ class AppGenerator < Rails::Generator::Base super usage if args.empty? @destination_root = args.shift + @socket = `mysql_config --socket`.strip + @socket = '/path/to/your/mysql.sock' if @socket.blank? end def manifest @@ -32,7 +34,10 @@ class AppGenerator < Rails::Generator::Base m.template "helpers/test_helper.rb", "test/test_helper.rb" # database.yml and .htaccess - m.template "configs/database.yml", "config/database.yml", :assigns => { :app_name => File.basename(File.expand_path(@destination_root)) } + m.template "configs/database.yml", "config/database.yml", :assigns => { + :app_name => File.basename(File.expand_path(@destination_root)), + :socket => @socket + } m.template "configs/routes.rb", "config/routes.rb" m.template "configs/apache.conf", "public/.htaccess" |