Module: Kernel
- Defined in:
- lib/irt/extensions/rails_server.rb,
lib/irt/extensions/kernel.rb
Overview
this file patches the rack server and irt in order to enter irt from the server execution you should require this file after loading irt.rb
Instance Method Summary collapse
-
#capture(stream = :stdout) ⇒ Object
(also: #silence)
copied from ActiveRecord 3.1 because of conflicting name with previous IRT implementation modified in the argument default in order to be used by both AR and IRT.
- #irt(bind) ⇒ Object
- #original_irt ⇒ Object
Instance Method Details
#capture(stream = :stdout) ⇒ Object Also known as: silence
copied from ActiveRecord 3.1 because of conflicting name with previous IRT implementation modified in the argument default in order to be used by both AR and IRT
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/irt/extensions/kernel.rb', line 6 def capture(stream=:stdout) begin stream = stream.to_s eval "$#{stream} = StringIO.new" yield result = eval("$#{stream}").string ensure eval("$#{stream} = #{stream.upcase}") end result end |