Skip to content
Browse files

Fixed that rails --version should have the return code of 0 (success)…

… (closes #4560) [blair@orcaware.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4145 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent bb4c679 commit 46796e74cfbb8f07b9bfc6d28dcf9867f4c664c0 @dhh dhh committed Apr 3, 2006
Showing with 7 additions and 2 deletions.
  1. +2 −0 railties/CHANGELOG
  2. +4 −1 railties/bin/rails
  3. +1 −1 railties/lib/dispatcher.rb
View
2 railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed that rails --version should have the return code of 0 (success) #4560 [blair@orcaware.com]
+
* Install alias so Rails::InfoController is accessible at /rails_info. Closes #4546. [Nicholas Seckar]
* Fixed that spawner should daemonize if running in repeat mode [DHH]
View
5 railties/bin/rails
@@ -2,7 +2,10 @@ require File.dirname(__FILE__) + '/../lib/ruby_version_check'
Signal.trap("INT") { puts; exit }
require File.dirname(__FILE__) + '/../lib/rails/version'
-abort "Rails #{Rails::VERSION::STRING}" if %w(--version -v).include? ARGV.first
+if %w(--version -v).include? ARGV.first
+ puts "Rails #{Rails::VERSION::STRING}"
+ exit(0)
+end
freeze = ARGV.any? { |option| %w(--freeze -f).include?(option) }
app_path = ARGV.first
View
2 railties/lib/dispatcher.rb
@@ -91,7 +91,7 @@ def failsafe_response(output, status, exception = nil)
begin
output.write "Status: #{status}\r\n"
output.write "Content-Type: text/plain\r\n\r\n"
- output.write exception.to_s + "\r\n" + exception.backtrace.join("\r\n") if exception
+ output.write(exception.to_s + "\r\n" + exception.backtrace.join("\r\n")) if exception
rescue Object
end
end

0 comments on commit 46796e7

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