Class: Vagrant::UI::Captured
- Inherits:
-
Interface
- Object
- Interface
- Vagrant::UI::Captured
- Includes:
- Util::SafePuts
- Defined in:
- lib/vagrant/dsl.rb
Instance Attribute Summary collapse
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
- #ask(*args) ⇒ Object
-
#initialize(resource) ⇒ Captured
constructor
A new instance of Captured.
- #say(type, message, opts = nil) ⇒ Object
Constructor Details
#initialize(resource) ⇒ Captured
Returns a new instance of Captured.
14 15 16 17 18 |
# File 'lib/vagrant/dsl.rb', line 14 def initialize(resource) super @stdout = StringIO.new("", 'w+') @stderr = StringIO.new("", 'w+') end |
Instance Attribute Details
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
12 13 14 |
# File 'lib/vagrant/dsl.rb', line 12 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
11 12 13 |
# File 'lib/vagrant/dsl.rb', line 11 def stdout @stdout end |
Instance Method Details
#ask(*args) ⇒ Object
20 21 22 23 |
# File 'lib/vagrant/dsl.rb', line 20 def ask(*args) super raise Errors::UIExpectsTTY end |
#say(type, message, opts = nil) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/vagrant/dsl.rb', line 34 def say(type, , opts=nil) safe_puts( , :io => type == :error ? @stderr : @stdout, :printer => :puts ) end |