<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -138,7 +138,12 @@ class AbstractServer
 				# on a white list of file descriptors. That proved to be way too fragile:
 				# too many file descriptors are being left open even though they shouldn't
 				# be. So now we close file descriptors based on a black list.
-				file_descriptors_to_leave_open = [0, 1, 2, @child_socket.fileno]
+				#
+				# Note that STDIN, STDOUT and STDERR may be temporarily set to
+				# different file descriptors than 0, 1 and 2, e.g. in unit tests.
+				# We don't want to close these either.
+				file_descriptors_to_leave_open = [0, 1, 2, @child_socket.fileno,
+					fileno_of(STDIN), fileno_of(STDOUT), fileno_of(STDERR)].compact.uniq
 				NativeSupport.close_all_file_descriptors(file_descriptors_to_leave_open)
 				# In addition to closing the file descriptors, one must also close
 				# the associated IO objects. This is to prevent IO.close from
@@ -295,6 +300,12 @@ protected
 	def quit_main
 		@done = true
 	end
+	
+	def fileno_of(io)
+		return io.fileno
+	rescue
+		return nil
+	end
 
 private
 	# Reset all signal handlers to default. This is called in the child process,</diff>
      <filename>lib/phusion_passenger/abstract_server.rb</filename>
    </modified>
    <modified>
      <diff>@@ -72,7 +72,7 @@ class ApplicationSpawner
 		Process.waitpid(pid) rescue nil
 		
 		channel = MessageChannel.new(a)
-		unmarshal_and_raise_errors(channel, &quot;rack&quot;)
+		unmarshal_and_raise_errors(channel, !!options[&quot;print_exceptions&quot;], &quot;rack&quot;)
 		
 		# No exception was raised, so spawning succeeded.
 		pid, socket_name, socket_type = channel.read</diff>
      <filename>lib/phusion_passenger/rack/application_spawner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -94,6 +94,10 @@ class ApplicationSpawner &lt; AbstractServer
 	#   string if the application is deployed on the root URI. It must not
 	#   equal the empty string.
 	#
+	# - +print_exceptions+:
+	#   Whether exceptions that have occurred during application initialization
+	#   should be printed to STDERR. The default is true.
+	#
 	# All other options will be passed on to RequestHandler.
 	def initialize(app_root, options = {})
 		super()
@@ -105,6 +109,7 @@ class ApplicationSpawner &lt; AbstractServer
 		@environment     = @options[&quot;environment&quot;]
 		@encoded_environment_variables = @options[&quot;environment_variables&quot;]
 		@base_uri = @options[&quot;base_uri&quot;] if @options[&quot;base_uri&quot;] &amp;&amp; @options[&quot;base_uri&quot;] != &quot;/&quot;
+		@print_exceptions = @options[&quot;print_exceptions&quot;]
 		self.max_idle_time = DEFAULT_APP_SPAWNER_MAX_IDLE_TIME
 		assert_valid_app_root(@app_root)
 		define_message_handler(:spawn_application, :handle_spawn_application)
@@ -186,7 +191,7 @@ class ApplicationSpawner &lt; AbstractServer
 		Process.waitpid(pid) rescue nil
 		
 		channel = MessageChannel.new(a)
-		unmarshal_and_raise_errors(channel)
+		unmarshal_and_raise_errors(channel, @print_exceptions)
 		
 		# No exception was raised, so spawning succeeded.
 		pid, socket_name, socket_type = channel.read
@@ -207,7 +212,7 @@ class ApplicationSpawner &lt; AbstractServer
 	def start
 		super
 		begin
-			unmarshal_and_raise_errors(server)
+			unmarshal_and_raise_errors(server, @print_exceptions)
 		rescue IOError, SystemCallError, SocketError =&gt; e
 			stop
 			raise Error, &quot;The application spawner server exited unexpectedly: #{e}&quot;</diff>
      <filename>lib/phusion_passenger/railz/application_spawner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -58,6 +58,9 @@ class FrameworkSpawner &lt; AbstractServer
 	#   this version is actually installed.
 	# - &lt;tt&gt;:vendor&lt;/tt&gt;: The directory to the vendor Rails framework to use. This is
 	#   usually something like &quot;/webapps/foo/vendor/rails&quot;.
+	# - &lt;tt&gt;:print_framework_loading_exceptions&lt;/tt&gt;:
+	#   Whether exceptions that have occurred while loading the Ruby on Rails framework
+	#   should be printed to STDERR. The default is true.
 	#
 	# It is not allowed to specify both +version+ and +vendor+.
 	#
@@ -72,6 +75,11 @@ class FrameworkSpawner &lt; AbstractServer
 		end
 		@version = options[:version]
 		@vendor  = options[:vendor]
+		if options.has_key?(:print_framework_loading_exceptions)
+			@print_framework_loading_exceptions = options[:print_framework_loading_exceptions]
+		else
+			@print_framework_loading_exceptions = true
+		end
 		if !@version &amp;&amp; !@vendor
 			raise ArgumentError, &quot;Either the 'version' or the 'vendor' option must specified&quot;
 		elsif @version &amp;&amp; @vendor
@@ -87,7 +95,7 @@ class FrameworkSpawner &lt; AbstractServer
 	# Overrided from AbstractServer#start.
 	#
 	# May raise these additional exceptions:
-	# - FrameworkInitError: The specified Ruby on Rails framework could not be loaded.
+	# - FrameworkInitError: An error occurred while loading the specified Ruby on Rails framework.
 	# - FrameworkSpawner::Error: The FrameworkSpawner server exited unexpectedly.
 	def start
 		super
@@ -109,6 +117,9 @@ class FrameworkSpawner &lt; AbstractServer
 						&quot;#{child_exception.class} (#{child_exception.message})&quot;
 				end
 				options = { :vendor =&gt; @vendor, :version =&gt; @version }
+				if @print_framework_loading_exceptions
+					print_exception(self.class.to_s, child_exception)
+				end
 				raise FrameworkInitError.new(message, child_exception, options)
 			end
 		rescue IOError, SystemCallError, SocketError
@@ -122,23 +133,7 @@ class FrameworkSpawner &lt; AbstractServer
 	# When successful, an Application object will be returned, which represents
 	# the spawned RoR application.
 	#
-	# The following options are allowed:
-	# - +lower_privilege+ and +lowest_user+:
-	#   If +lower_privilege+ is true, then ApplicationSpawner will attempt to
-	#   switch to the user who owns the application's &lt;tt&gt;config/environment.rb&lt;/tt&gt;,
-	#   and to the default group of that user.
-	#
-	#   If that user doesn't exist on the system, or if that user is root,
-	#   then ApplicationSpawner will attempt to switch to the username given by
-	#   +lowest_user+ (and to the default group of that user).
-	#   If +lowest_user+ doesn't exist either, or if switching user failed
-	#   (because the current process does not have the privilege to do so),
-	#   then ApplicationSpawner will continue without reporting an error.
-	#
-	# - +environment+:
-	#   Allows one to specify the RAILS_ENV environment to use.
-	#
-	# All other options will be passed on to ApplicationSpawner and RequestHandler.
+	# All options accepted by ApplicationSpawner.new and RequestHandler.new are accepted.
 	#
 	# FrameworkSpawner will internally cache the code of applications, in order to
 	# speed up future spawning attempts. This implies that, if you've changed
@@ -148,7 +143,7 @@ class FrameworkSpawner &lt; AbstractServer
 	#
 	# Raises:
 	# - AbstractServer::ServerNotStarted: The FrameworkSpawner server hasn't already been started.
-	# - InvalidAppRoot: +app_root+ doesn't appear to be a valid Ruby on Rails application root.
+	# - InvalidPath: +app_root+ doesn't appear to be a valid Ruby on Rails application root.
 	# - AppInitError: The application raised an exception or called exit() during startup.
 	# - ApplicationSpawner::Error: The ApplicationSpawner server exited unexpectedly.
 	# - FrameworkSpawner::Error: The FrameworkSpawner server exited unexpectedly.
@@ -156,8 +151,12 @@ class FrameworkSpawner &lt; AbstractServer
 		assert_valid_app_root(app_root)
 		options = sanitize_spawn_options(options)
 		options[&quot;app_root&quot;] = app_root
+		# No need for the ApplicationSpawner to print exceptions. All
+		# exceptions raised by the ApplicationSpawner are sent back here,
+		# so we just need to decide here whether we want to print it.
+		print_exceptions = options[&quot;print_exceptions&quot;]
+		options[&quot;print_exceptions&quot;] = false
 		
-		exception_to_propagate = nil
 		begin
 			server.write(&quot;spawn_application&quot;, *options.to_a.flatten)
 			result = server.read
@@ -166,8 +165,10 @@ class FrameworkSpawner &lt; AbstractServer
 			end
 			if result[0] == 'exception'
 				e = unmarshal_exception(server.read_scalar)
-				if e.respond_to?(:child_exception) &amp;&amp; e.child_exception
-					#print_exception(self.class.to_s, e.child_exception)
+				if print_exceptions &amp;&amp; e.respond_to?(:child_exception) &amp;&amp; e.child_exception
+					print_exception(self.class.to_s, e.child_exception)
+				elsif print_exceptions
+					print_exception(self.class.to_s, e)
 				end
 				raise e
 			else
@@ -276,10 +277,7 @@ private
 	end
 
 	def handle_spawn_application(*options)
-		options = Hash[*options]
-		options[&quot;lower_privilege&quot;]     = options[&quot;lower_privilege&quot;] == &quot;true&quot;
-		options[&quot;app_spawner_timeout&quot;] = options[&quot;app_spawner_timeout&quot;].to_i
-		options[&quot;memory_limit&quot;]        = options[&quot;memory_limit&quot;].to_i
+		options = sanitize_spawn_options(Hash[*options])
 		
 		app = nil
 		app_root = options[&quot;app_root&quot;]
@@ -293,10 +291,10 @@ private
 					spawner.start
 					spawner
 				end
-			rescue ArgumentError, AppInitError, ApplicationSpawner::Error =&gt; e
+			rescue InvalidPath, AppInitError, ApplicationSpawner::Error =&gt; e
 				client.write('exception')
 				client.write_scalar(marshal_exception(e))
-				if e.child_exception.is_a?(LoadError)
+				if e.respond_to?(:child_exception) &amp;&amp; e.child_exception.is_a?(LoadError)
 					# A source file failed to load, maybe because of a
 					# missing gem. If that's the case then the sysadmin
 					# will install probably the gem. So we clear RubyGems's</diff>
      <filename>lib/phusion_passenger/railz/framework_spawner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -97,7 +97,7 @@ class SpawnManager &lt; AbstractServer
 	#
 	# Other options are:
 	#
-	# ['lower_privilege', 'lowest_user', 'environment', 'environment_variables' and 'base_uri']
+	# ['lower_privilege', 'lowest_user', 'environment', 'environment_variables', 'base_uri' and 'print_exceptions']
 	#   See Railz::ApplicationSpawner.new for an explanation of these options.
 	# 
 	# ['app_type']
@@ -234,7 +234,11 @@ private
 			else
 				key = &quot;version:#{framework_version}&quot;
 				create_spawner = proc do
-					Railz::FrameworkSpawner.new(:version =&gt; framework_version)
+					framework_options = { :version =&gt; framework_version }
+					if options.has_key?(:print_framework_loading_exceptions)
+						framework_options[:print_framework_loading_exceptions] = options[:print_framework_loading_exceptions]
+					end
+					Railz::FrameworkSpawner.new(framework_options)
 				end
 				spawner_timeout = options[&quot;framework_spawner_timeout&quot;]
 			end</diff>
      <filename>lib/phusion_passenger/spawn_manager.rb</filename>
    </modified>
    <modified>
      <diff>@@ -154,10 +154,10 @@ protected
 	#
 	# +current_location+ is a string which describes where the code is
 	# currently at. Usually the current class name will be enough.
-	def print_exception(current_location, exception)
+	def print_exception(current_location, exception, destination = STDERR)
 		if !exception.is_a?(SystemExit)
-			STDERR.puts(exception.backtrace_string(current_location))
-			STDERR.flush
+			destination.puts(exception.backtrace_string(current_location))
+			destination.flush if destination.respond_to?(:flush)
 		end
 	end
 	
@@ -264,13 +264,24 @@ protected
 	# received information, then an appropriate exception will be
 	# raised.
 	#
+	# If &lt;tt&gt;print_exception&lt;/tt&gt; evaluates to true, then the
+	# exception message and the backtrace will also be printed.
+	# Where it is printed to depends on the type of
+	# &lt;tt&gt;print_exception&lt;/tt&gt;:
+	# - If it responds to #puts, then the exception information will
+	#   be printed using this method.
+	# - If it responds to #to_str, then the exception information
+	#   will be appended to the file whose filename equals the return
+	#   value of the #to_str call.
+	# - Otherwise, it will be printed to STDERR.
+	#
 	# Raises:
 	# - AppInitError: this class wraps the exception information
 	#   received through the channel.
 	# - IOError, SystemCallError, SocketError: these errors are
 	#   raised if an error occurred while receiving the information
 	#   through the channel.
-	def unmarshal_and_raise_errors(channel, app_type = &quot;rails&quot;)
+	def unmarshal_and_raise_errors(channel, print_exception = nil, app_type = &quot;rails&quot;)
 		args = channel.read
 		if args.nil?
 			raise EOFError, &quot;Unexpected end-of-file detected.&quot;
@@ -279,8 +290,7 @@ protected
 		if status == 'exception'
 			child_exception = unmarshal_exception(channel.read_scalar)
 			stderr = channel.read_scalar
-			#print_exception(self.class.to_s, child_exception)
-			raise AppInitError.new(
+			exception = AppInitError.new(
 				&quot;Application '#{@app_root}' raised an exception: &quot; &lt;&lt;
 				&quot;#{child_exception.class} (#{child_exception.message})&quot;,
 				child_exception,
@@ -289,9 +299,25 @@ protected
 		elsif status == 'exit'
 			child_exception = unmarshal_exception(channel.read_scalar)
 			stderr = channel.read_scalar
-			raise AppInitError.new(&quot;Application '#{@app_root}' exited during startup&quot;,
+			exception = AppInitError.new(&quot;Application '#{@app_root}' exited during startup&quot;,
 				child_exception, app_type, stderr.empty? ? nil : stderr)
+		else
+			exception = nil
+		end
+		
+		if print_exception &amp;&amp; exception
+			if print_exception.respond_to?(:puts)
+				print_exception(self.class.to_s, child_exception, print_exception)
+			elsif print_exception.respond_to?(:to_str)
+				filename = print_exception.to_str
+				File.open(filename, 'a') do |f|
+					print_exception(self.class.to_s, child_exception, f)
+				end
+			else
+				print_exception(self.class.to_s, child_exception)
+			end
 		end
+		raise exception if exception
 	end
 	
 	# Lower the current process's privilege to the owner of the given file.
@@ -340,6 +366,10 @@ protected
 		end
 	end
 	
+	def to_boolean(value)
+		return !(value.nil? || value == false || value == &quot;false&quot;)
+	end
+	
 	def sanitize_spawn_options(options)
 		defaults = {
 			&quot;lower_privilege&quot; =&gt; true,
@@ -348,12 +378,15 @@ protected
 			&quot;app_type&quot;        =&gt; &quot;rails&quot;,
 			&quot;spawn_method&quot;    =&gt; &quot;smart-lv2&quot;,
 			&quot;framework_spawner_timeout&quot; =&gt; -1,
-			&quot;app_spawner_timeout&quot;       =&gt; -1
+			&quot;app_spawner_timeout&quot;       =&gt; -1,
+			&quot;print_exceptions&quot; =&gt; true
 		}
 		options = defaults.merge(options)
-		options[&quot;lower_privilege&quot;]           = options[&quot;lower_privilege&quot;].to_s == &quot;true&quot;
+		options[&quot;lower_privilege&quot;]           = to_boolean(options[&quot;lower_privilege&quot;])
 		options[&quot;framework_spawner_timeout&quot;] = options[&quot;framework_spawner_timeout&quot;].to_i
 		options[&quot;app_spawner_timeout&quot;]       = options[&quot;app_spawner_timeout&quot;].to_i
+		# Force this to be a boolean for easy use with Utils#unmarshal_and_raise_errors.
+		options[&quot;print_exceptions&quot;]          = to_boolean(options[&quot;print_exceptions&quot;])
 		return options
 	end
 	</diff>
      <filename>lib/phusion_passenger/utils.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ describe PhusionPassenger::Rack::ApplicationSpawner do
 	
 	it &quot;propagates exceptions in application startup&quot; do
 		File.prepend(&quot;#{@stub.app_root}/config.ru&quot;, &quot;raise StandardError, 'foo'\n&quot;)
-		spawn = lambda { spawn(@stub.app_root) }
+		spawn = lambda { spawn(@stub.app_root, &quot;print_exceptions&quot; =&gt; false) }
 		spawn.should raise_error(StandardError)
 	end
 	</diff>
      <filename>test/ruby/rack/application_spawner_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -97,8 +97,8 @@ describe FrameworkSpawner do
 		end
 	end
 	
-	def load_nonexistant_framework
-		spawner = FrameworkSpawner.new(:version =&gt; &quot;1.9.827&quot;)
+	def load_nonexistant_framework(options = {})
+		spawner = FrameworkSpawner.new(options.merge(:version =&gt; &quot;1.9.827&quot;))
 		begin
 			spawner.start
 		ensure</diff>
      <filename>test/ruby/rails/framework_spawner_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'stringio'
+
 shared_examples_for &quot;handling errors in application initialization&quot; do
 	before :each do
 		@stub = setup_rails_stub('foobar')
@@ -11,8 +13,8 @@ shared_examples_for &quot;handling errors in application initialization&quot; do
 	it &quot;raises an AppInitError if the spawned app raises a standard exception during startup&quot; do
 		File.prepend(@stub.environment_rb, &quot;raise 'This is a dummy exception.'\n&quot;)
 		begin
-			spawn_stub_application(@stub).close
-			violated &quot;Spawning the application should have raised an InitializationError.&quot;
+			spawn_stub_application(@stub, &quot;print_exceptions&quot; =&gt; false).close
+			violated &quot;Spawning the application should have raised an AppInitError.&quot;
 		rescue AppInitError =&gt; e
 			e.child_exception.message.should == &quot;This is a dummy exception.&quot;
 		end
@@ -26,8 +28,8 @@ shared_examples_for &quot;handling errors in application initialization&quot; do
 			raise MyError, &quot;This is a custom exception.&quot;
 		})
 		begin
-			spawn_stub_application(@stub).close
-			violated &quot;Spawning the application should have raised an InitializationError.&quot;
+			spawn_stub_application(@stub, &quot;print_exceptions&quot; =&gt; false).close
+			violated &quot;Spawning the application should have raised an AppInitError.&quot;
 		rescue AppInitError =&gt; e
 			e.child_exception.message.should == &quot;This is a custom exception. (MyError)&quot;
 		end
@@ -36,17 +38,70 @@ shared_examples_for &quot;handling errors in application initialization&quot; do
 	it &quot;raises an AppInitError if the spawned app calls exit() during startup&quot; do
 		File.prepend(@stub.environment_rb, &quot;exit\n&quot;)
 		begin
-			spawn_stub_application(@stub).close
-			violated &quot;Spawning the application should have raised an InitializationError.&quot;
+			spawn_stub_application(@stub, &quot;print_exceptions&quot; =&gt; false).close
+			violated &quot;Spawning the application should have raised an AppInitError.&quot;
 		rescue AppInitError =&gt; e
 			e.child_exception.class.should == SystemExit
 		end
 	end
+	
+	it &quot;prints the exception to STDERR if the spawned app raised an error&quot; do
+		old_stderr = STDERR
+		file = File.new('output.tmp', 'w+')
+		begin
+			Object.send(:remove_const, &quot;STDERR&quot;) rescue nil
+			Object.const_set(&quot;STDERR&quot;, file)
+			
+			File.prepend(@stub.environment_rb, &quot;raise 'This is a dummy exception.'\n&quot;)
+			block = lambda do
+				spawn_stub_application(@stub).close
+			end
+			block.should raise_error(AppInitError)
+			
+			file.rewind
+			data = file.read
+			data.should =~ /spawn_stub_application/
+			data.should =~ /spawner_error_handling_spec\.rb/
+		ensure
+			Object.send(:remove_const, &quot;STDERR&quot;) rescue nil
+			Object.const_set(&quot;STDERR&quot;, old_stderr)
+			file.close rescue nil
+			File.unlink('output.tmp') rescue nil
+		end
+	end
 end
 
 shared_examples_for &quot;handling errors in framework initialization&quot; do
 	include Utils
+	
 	it &quot;raises FrameworkInitError if the framework could not be loaded&quot; do
-		lambda { load_nonexistant_framework.close }.should raise_error(FrameworkInitError)
+		block = lambda do
+			load_nonexistant_framework(:print_framework_loading_exceptions =&gt; false).close
+		end
+		block.should raise_error(FrameworkInitError)
+	end
+	
+	it &quot;prints the exception to STDERR if the framework could not be loaded&quot; do
+		old_stderr = STDERR
+		file = File.new('output.tmp', 'w+')
+		begin
+			Object.send(:remove_const, &quot;STDERR&quot;) rescue nil
+			Object.const_set(&quot;STDERR&quot;, file)
+			
+			block = lambda do
+				load_nonexistant_framework.close
+			end
+			block.should raise_error(FrameworkInitError)
+			
+			file.rewind
+			data = file.read
+			data.should =~ /load_nonexistant_framework/
+			data.should =~ /spawner_error_handling_spec\.rb/
+		ensure
+			Object.send(:remove_const, &quot;STDERR&quot;) rescue nil
+			Object.const_set(&quot;STDERR&quot;, old_stderr)
+			file.close rescue nil
+			File.unlink('output.tmp') rescue nil
+		end
 	end
 end</diff>
      <filename>test/ruby/rails/spawner_error_handling_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 require 'support/config'
 require 'support/test_helper'
+require 'phusion_passenger/application'
 require 'phusion_passenger/spawn_manager'
 
 require 'ruby/abstract_server_spec'
@@ -183,7 +184,7 @@ describe SpawnManager do
 		end
 	end
 	
-	def load_nonexistant_framework
+	def load_nonexistant_framework(extra_options = {})
 		# Prevent detect_framework_version from raising VersionNotFound
 		Application.instance_eval do
 			alias orig_detect_framework_version detect_framework_version
@@ -194,7 +195,7 @@ describe SpawnManager do
 		begin
 			File.write(@stub.environment_rb, &quot;RAILS_GEM_VERSION = '1.9.827'&quot;)
 			@stub.dont_use_vendor_rails
-			return spawn_stub_application(@stub)
+			return spawn_stub_application(@stub, extra_options)
 		ensure
 			Application.instance_eval do
 				alias detect_framework_version orig_detect_framework_version</diff>
      <filename>test/ruby/spawn_manager_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -164,6 +164,53 @@ describe Utils do
 		end
 	end
 	
+	describe &quot;#unmarshal_and_raise_errors&quot; do
+		before :each do
+			@a, @b = IO.pipe
+			@report_channel = MessageChannel.new(@a)
+			report_app_init_status(MessageChannel.new(@b)) do
+				raise StandardError, &quot;Something went wrong!&quot;
+			end
+		end
+		
+		after :each do
+			@a.close rescue nil
+			@b.close rescue nil
+		end
+		
+		it &quot;prints the exception information to the 'print_exception' argument using #puts, if 'print_exception' responds to that&quot; do
+			buffer = StringIO.new
+			lambda { unmarshal_and_raise_errors(@report_channel, buffer) }.should raise_error(AppInitError)
+			buffer.string.should =~ /Something went wrong!/
+			buffer.string.should =~ /utils\.rb/
+			buffer.string.should =~ /utils_spec\.rb/
+		end
+		
+		it &quot;appends the exception information to the file pointed to by 'print_exception', if 'print_exception' responds to #to_str&quot; do
+			begin
+				lambda { unmarshal_and_raise_errors(@report_channel, &quot;exception.txt&quot;) }.should raise_error(AppInitError)
+				data = File.read('exception.txt')
+				data.should =~ /Something went wrong!/
+				data.should =~ /utils\.rb/
+				data.should =~ /utils_spec\.rb/
+			ensure
+				File.unlink('exception.txt') rescue nil
+			end
+		end
+	end
+	
+	specify &quot;#to_boolean works&quot; do
+		to_boolean(nil).should be_false
+		to_boolean(false).should be_false
+		to_boolean(true).should be_true
+		to_boolean(1).should be_true
+		to_boolean(0).should be_true
+		to_boolean(&quot;&quot;).should be_true
+		to_boolean(&quot;true&quot;).should be_true
+		to_boolean(&quot;false&quot;).should be_false
+		to_boolean(&quot;bla bla&quot;).should be_true
+	end
+	
 	describe &quot;#passenger_tmpdir&quot; do
 		before :each do
 			@old_passenger_tmpdir = Utils.passenger_tmpdir</diff>
      <filename>test/ruby/utils_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>237c6e04dd6518cfa86b2204fa43e6d0c14bcd82</id>
    </parent>
  </parents>
  <author>
    <name>Hongli Lai (Phusion)</name>
    <email>hongli@phusion.nl</email>
  </author>
  <url>http://github.com/FooBarWidget/passenger/commit/ac4a005fbb860cddecab46e38d79de8e8c1677d5</url>
  <id>ac4a005fbb860cddecab46e38d79de8e8c1677d5</id>
  <committed-date>2009-06-04T13:53:17-07:00</committed-date>
  <authored-date>2009-05-29T07:50:15-07:00</authored-date>
  <message>When an application fails to start, log the exception it to STDERR (which is usually the web server's log file). Fixes issue #210.</message>
  <tree>4f604c6a54f1219feeb5e12c59ddb27663664830</tree>
  <committer>
    <name>Hongli Lai (Phusion)</name>
    <email>hongli@phusion.nl</email>
  </committer>
</commit>
