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

inherited(klass) click to toggle source
# File lib/vagrant/ui/remote.rb, line 12
def self.inherited(klass)
  klass.prepend(Reformatter)
end
new() click to toggle source
# File lib/vagrant/ui.rb, line 34
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 68
def color?
  return false
end
initialize_copy(original) click to toggle source
Calls superclass method
# File lib/vagrant/ui.rb, line 43
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 76
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 83
def rewriting
  yield self
end
to_proto() click to toggle source
# File lib/vagrant/ui.rb, line 87
def to_proto
  raise NotImplementedError,
    "Vagrant::UI::Interface#to_proto"
end