Module: Kernel
- Defined in:
- lib/jets/core_ext/kernel.rb
Overview
Works with jets/io.rb
Constant Summary collapse
- @@io_buffer =
[]
Instance Method Summary collapse
-
#io_buffer ⇒ Object
TODO: implement other methods that write output: p, print, printf, putc, puts, sprintf? Also, would be nice to figure out pp method also.
- #io_flush ⇒ Object
- #original_puts ⇒ Object
- #puts(message) ⇒ Object
Instance Method Details
#io_buffer ⇒ Object
TODO: implement other methods that write output: p, print, printf, putc, puts, sprintf? Also, would be nice to figure out pp method also.
15 16 17 |
# File 'lib/jets/core_ext/kernel.rb', line 15 def io_buffer @@io_buffer end |
#io_flush ⇒ Object
19 20 21 22 |
# File 'lib/jets/core_ext/kernel.rb', line 19 def io_flush IO.write("/tmp/jets-output.log", @@io_buffer.join("\n")) @@io_buffer = [] end |
#original_puts ⇒ Object
5 |
# File 'lib/jets/core_ext/kernel.rb', line 5 alias_method :original_puts, :puts |
#puts(message) ⇒ Object
6 7 8 9 |
# File 'lib/jets/core_ext/kernel.rb', line 6 def puts() @@io_buffer << original_puts() end |