1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Windows: eliminate the socket option in database.yml. Closes #2924.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3082 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2005-11-18 07:30:05 +00:00
parent db871c8d54
commit ae76e22731
3 changed files with 33 additions and 15 deletions

View file

@ -1,5 +1,7 @@
*SVN* *SVN*
* Windows: eliminate the socket option in database.yml. #2924 [Wayne Vucenic <waynev@gmail.com>]
* Eliminate nil from newly generated logfiles. #2927 [Blair Zajac <blair@orcaware.com>] * Eliminate nil from newly generated logfiles. #2927 [Blair Zajac <blair@orcaware.com>]
* Update to Prototype 1.4.0_rc3. Closes #1893, #2505, #2550, #2748, #2783. [Sam Stephenson] * Update to Prototype 1.4.0_rc3. Closes #1893, #2505, #2550, #2748, #2783. [Sam Stephenson]

View file

@ -1,8 +1,13 @@
# MySQL (default setup). Versions 4.1 and 5.0 are recommended. # MySQL (default setup). Versions 4.1 and 5.0 are recommended.
# #
# Get the fast C bindings: # Install the MySQL driver:
# gem install mysql # gem install mysql
# (on OS X: gem install mysql -- --include=/usr/local/lib) # On MacOS X:
# gem install mysql -- --include=/usr/local/lib
# On Windows:
# There is no gem for Windows. Install mysql.so from RubyForApache.
# http://rubyforge.org/projects/rubyforapache
#
# And be sure to use new-style password hashing: # And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development: development:
@ -10,12 +15,11 @@ development:
database: <%= app_name %>_development database: <%= app_name %>_development
username: root username: root
password: password:
<%= " socket: #{socket}" if socket %> <% if socket -%>
socket: <%= socket %>
# Connect on a TCP socket. If omitted, the adapter will connect on the <% else -%>
# domain socket given by socket instead. host: localhost
#host: localhost <% end -%>
#port: 3306
# Warning: The database defined as 'test' will be erased and # Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'. # re-generated from your development database when you run 'rake'.
@ -25,16 +29,26 @@ test:
database: <%= app_name %>_test database: <%= app_name %>_test
username: root username: root
password: password:
<%= " socket: #{socket}" if socket %> <% if socket -%>
socket: <%= socket %>
<% else -%>
host: localhost
<% end -%>
production: production:
adapter: mysql adapter: mysql
database: <%= app_name %>_production database: <%= app_name %>_production
username: root username: root
password: password:
<%= " socket: #{socket}" if socket %> <% if socket -%>
socket: <%= socket %>
<% else -%>
host: localhost
<% end -%>
### Example database connections. You can safely delete these. ###
# PostgreSQL versions 7.4 - 8.1 # PostgreSQL versions 7.4 - 8.1
# #
# Get the C bindings: # Get the C bindings:
@ -48,8 +62,9 @@ postgresql_example:
password: password:
# Connect on a TCP socket. Omitted by default since the client uses a # Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. # domain socket that doesn't need configuration. Windows does not have
#host: remote-database # domain sockets, so uncomment these lines.
#host: localhost
#port: 5432 #port: 5432
# Schema search path. The server defaults to $user,public # Schema search path. The server defaults to $user,public

View file

@ -11,8 +11,9 @@ class AppGenerator < Rails::Generator::Base
super super
usage if args.empty? usage if args.empty?
@destination_root = args.shift @destination_root = args.shift
unless RUBY_PLATFORM =~ /mswin32/
@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
end end
def manifest def manifest