Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add default Mac + DarwinPorts MySQL socket locations to the app gener…

…ator.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2800 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 24e3dbb8062e3435fd74dea590229ea841bf45a9 1 parent 4194384
@jeremy jeremy authored
View
2  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]
View
16 railties/lib/rails_generator/generators/applications/app/app_generator.rb
@@ -11,7 +11,7 @@ def initialize(runtime_args, runtime_options = {})
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 @@ def add_options!(opt)
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
Please sign in to comment.
Something went wrong with that request. Please try again.