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

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
上级 bb4c6797
*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]
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册