diff options
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/app_generator.rb | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 14b478e3db..cdf56c7dcc 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Add default Mac + DarwinPorts MySQL socket locations to the app generator. [Jeremy Kemper] + * Migrations may be destroyed: script/destroy migration foo. #2635 [Charles M. Gerungan <charles.gerungan@gmail.com>, Jamis Buck, Jeremy Kemper] * Added that plugins can carry generators and that generator stub files can be created along with new plugins using script/generate plugin <name> --with-generator [DHH] 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 e43a0433ae..3d7f9e1652 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -11,7 +11,7 @@ class AppGenerator < Rails::Generator::Base super usage if args.empty? @destination_root = args.shift - @socket = MYSQL_SOCKET_LOCATIONS.find {|f| File.exists?(f) } + @socket = MYSQL_SOCKET_LOCATIONS.find { |f| File.exists?(f) } @socket = '/path/to/your/mysql.sock' if @socket.blank? end @@ -128,8 +128,14 @@ class AppGenerator < Rails::Generator::Base vendor/plugins ) - MYSQL_SOCKET_LOCATIONS = [ "/tmp/mysql.sock", #default - "/var/run/mysqld/mysqld.sock", #debian/gentoo - "/var/tmp/mysql.sock", # freebsd - "/var/lib/mysql/mysql.sock" ] #fedora + MYSQL_SOCKET_LOCATIONS = [ + "/tmp/mysql.sock", # default + "/var/run/mysqld/mysqld.sock", # debian/gentoo + "/var/tmp/mysql.sock", # freebsd + "/var/lib/mysql/mysql.sock", # fedora + "/opt/local/lib/mysql/mysql.sock", # fedora + "/opt/local/var/run/mysqld/mysqld.sock", # mac + darwinports + mysql + "/opt/local/var/run/mysql4/mysqld.sock", # mac + darwinports + mysql4 + "/opt/local/var/run/mysql5/mysqld.sock" # mac + darwinports + mysql5 + ] end |