Skip to content
This repository
Browse code

Fix rake dev and related commands

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2653 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 98c1735f0313a08563d8cb92fcbff48b2be906fc 1 parent 50a02ab
Nicholas Seckar authored October 16, 2005
2  railties/CHANGELOG
... ...
@@ -1,5 +1,7 @@
1 1
 *SVN*
2 2
 
  3
+* Fix rake dev and related commands [Nicholas Seckar]
  4
+
3 5
 * The rails command tries to deduce your MySQL socket by running `mysql_config
4 6
 --socket`.  If it fails, default to /path/to/your/mysql.sock
5 7
 
6  railties/Rakefile
@@ -156,7 +156,11 @@ task :copy_application do
156 156
 end
157 157
 
158 158
 task :copy_configs do
159  
-  cp "configs/database.yml", "#{PKG_DESTINATION}/config/database.yml"
  159
+  app_name = "rails"
  160
+  socket = nil
  161
+  require 'erb'
  162
+  File.open("#{PKG_DESTINATION}/config/database.yml", 'w') {|f| f.write ERB.new(IO.read("configs/database.yml")).result(binding)}
  163
+  
160 164
   cp "configs/routes.rb", "#{PKG_DESTINATION}/config/routes.rb"
161 165
 
162 166
   cp "configs/apache.conf", "#{PKG_DESTINATION}/public/.htaccess"
6  railties/configs/database.yml
... ...
@@ -1,7 +1,7 @@
1 1
 development:
2 2
   adapter: mysql
3 3
   database: <%= app_name %>_development
4  
-  socket: <%= socket %>
  4
+  <%= "socket: #{socket}" if socket %>
5 5
   username: root
6 6
   password:
7 7
   # With the MySQL adapter on localhost, it defaults to /tmp/mysql.sock
@@ -13,13 +13,13 @@ development:
13 13
 test:
14 14
   adapter: mysql
15 15
   database: <%= app_name %>_test
16  
-  socket: <%= socket %>
  16
+  <%= "socket: #{socket}" if socket %>
17 17
   username: root
18 18
   password:
19 19
 
20 20
 production:
21 21
   adapter: mysql
22 22
   database: <%= app_name %>_production
23  
-  socket: <%= socket %>
  23
+  <%= "socket: #{socket}" if socket %>
24 24
   username: root
25 25
   password: 

0 notes on commit 98c1735

Please sign in to comment.
Something went wrong with that request. Please try again.