aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-05-21 11:05:18 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-05-21 11:05:18 +0000
commitca873648eab40d6ceb221c4d359c1f177fba0493 (patch)
tree79039130803c356708dd6713e6d54d351046ed7a /railties
parent10eb22cdce104326e319826af0ea4292940a9246 (diff)
downloadrails-ca873648eab40d6ceb221c4d359c1f177fba0493.tar.gz
rails-ca873648eab40d6ceb221c4d359c1f177fba0493.tar.bz2
rails-ca873648eab40d6ceb221c4d359c1f177fba0493.zip
Added graceful exit from pressing CTRL-C during the run of the rails command #1150 [Caleb Tennis]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1341 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG2
-rwxr-xr-xrailties/bin/rails4
2 files changed, 5 insertions, 1 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 51d9f2023a..5e797be8b8 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Added graceful exit from pressing CTRL-C during the run of the rails command #1150 [Caleb Tennis]
+
* Allow graceful exits for dispatch.fcgi processes by sending a SIGUSR1. If the process is currently handling a request, the request will be allowed to complete and then will terminate itself. If a request is not being handled, the process is terminated immediately (via #exit). This basically works like restart graceful on Apache. [Jamis Buck]
* Made dispatch.fcgi more robust by catching fluke errors and retrying unless its a permanent condition. [Jamis Buck]
diff --git a/railties/bin/rails b/railties/bin/rails
index b32b864e8a..3fb61137a1 100755
--- a/railties/bin/rails
+++ b/railties/bin/rails
@@ -1,6 +1,8 @@
abort "Rails requires Ruby 1.8.2" if RUBY_VERSION < "1.8.2"
+Signal.trap("INT") { puts; exit }
+
require File.dirname(__FILE__) + '/../lib/rails_generator'
require 'rails_generator/scripts/generate'
Rails::Generator::Base.use_application_sources!
-Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app') \ No newline at end of file
+Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app')