Class: HiveQueen::MultiIO
- Inherits:
-
Object
- Object
- HiveQueen::MultiIO
- Defined in:
- lib/capistrano/hivequeen/multiio.rb
Instance Method Summary collapse
-
#history ⇒ Object
Read the history from memory.
-
#initialize(output = $stderr) ⇒ MultiIO
constructor
A new instance of MultiIO.
- #puts(msg) ⇒ Object
- #tty? ⇒ Boolean
Constructor Details
#initialize(output = $stderr) ⇒ MultiIO
Returns a new instance of MultiIO.
7 8 9 10 |
# File 'lib/capistrano/hivequeen/multiio.rb', line 7 def initialize(output = $stderr) @memory = StringIO.new @output = output end |
Instance Method Details
#history ⇒ Object
Read the history from memory
17 18 19 20 |
# File 'lib/capistrano/hivequeen/multiio.rb', line 17 def history @memory.rewind @memory.read end |
#puts(msg) ⇒ Object
12 13 14 |
# File 'lib/capistrano/hivequeen/multiio.rb', line 12 def puts(msg) [@memory, @output].each{|t| t.puts(msg)} end |
#tty? ⇒ Boolean
22 23 24 |
# File 'lib/capistrano/hivequeen/multiio.rb', line 22 def tty? [@memory, @output].all?(&:tty?) end |