Class: Vendorificator::IOProxy
- Inherits:
-
StringIO
- Object
- StringIO
- Vendorificator::IOProxy
- Defined in:
- lib/vendorificator/io_proxy.rb
Instance Attribute Summary collapse
-
#shell ⇒ Object
readonly
Returns the value of attribute shell.
Instance Method Summary collapse
-
#initialize(shell, verbosity = :default) ⇒ IOProxy
constructor
A new instance of IOProxy.
- #puts(value, verb_level = :default) ⇒ Object
- #say(verb_level, *args) ⇒ Object
- #say_status(verb_level, *args) ⇒ Object
Constructor Details
#initialize(shell, verbosity = :default) ⇒ IOProxy
Returns a new instance of IOProxy.
7 8 9 10 11 12 13 |
# File 'lib/vendorificator/io_proxy.rb', line 7 def initialize(shell, verbosity = :default) @shell = shell @verbosity = verbosity super() capture_stdout end |
Instance Attribute Details
#shell ⇒ Object (readonly)
Returns the value of attribute shell.
5 6 7 |
# File 'lib/vendorificator/io_proxy.rb', line 5 def shell @shell end |
Instance Method Details
#puts(value, verb_level = :default) ⇒ Object
15 16 17 18 |
# File 'lib/vendorificator/io_proxy.rb', line 15 def puts(value, verb_level = :default) @orig_stdout.puts value if should_speak?(verb_level) super end |
#say(verb_level, *args) ⇒ Object
25 26 27 28 |
# File 'lib/vendorificator/io_proxy.rb', line 25 def say(verb_level, *args) write args[0] @shell.say(*args) if @shell && should_speak?(verb_level) end |
#say_status(verb_level, *args) ⇒ Object
20 21 22 23 |
# File 'lib/vendorificator/io_proxy.rb', line 20 def say_status(verb_level, *args) write args[0..1].join(' ' * @shell.padding) @shell.say_status(*args) if @shell && should_speak?(verb_level) end |