mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add default Mac + DarwinPorts MySQL socket locations to the app generator.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2800 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
4194384704
commit
24e3dbb806
2 changed files with 13 additions and 5 deletions
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue