class Vagrant::UI::Interface

Vagrant UIs handle communication with the outside world (typically through a shell). They must respond to the following methods:

Attributes

opts[RW]

Opts can be used to set some options. These options are implementation specific. See the implementation for more docs.

stderr[RW]

@return [IO] UI error output. Defaults to `$stderr`.

stdin[RW]

@return [IO] UI input. Defaults to `$stdin`.

stdout[RW]

@return [IO] UI output. Defaults to `$stdout`.

Public Class Methods

new() click to toggle source
# File lib/vagrant/ui.rb, line 33
def initialize
  @logger   = Log4r::Logger.new("vagrant::ui::interface")
  @opts     = {}

  @stdin  = $stdin
  @stdout = $stdout
  @stderr = $stderr
end

Public Instance Methods

color?() click to toggle source

@return [false]

# File lib/vagrant/ui.rb, line 67
def color?
  return false
end
initialize_copy(original) click to toggle source
Calls superclass method
# File lib/vagrant/ui.rb, line 42
def initialize_copy(original)
  super
  @opts = original.opts.dup
end
machine(type, *data) click to toggle source

For machine-readable output.

@param [String] type The type of the data @param [Array] data The data associated with the type

# File lib/vagrant/ui.rb, line 75
def machine(type, *data)
  @logger.info("Machine: #{type} #{data.inspect}")
end
rewriting() { |self| ... } click to toggle source

Yields self (UI) Provides a way for selectively displaying or not displaying updating content like download progress.

# File lib/vagrant/ui.rb, line 82
def rewriting
  yield self
end