Class: Vagrant::UI::Shell

Inherits:
Vagrant::UI show all
Defined in:
lib/vagrant/ui.rb

Overview

A shell UI, which uses a Thor::Shell object to talk with a terminal.

Instance Attribute Summary

Attributes inherited from Vagrant::UI

#env

Instance Method Summary collapse

Constructor Details

#initialize(env, shell) ⇒ Shell

Returns a new instance of Shell.



22
23
24
25
26
# File 'lib/vagrant/ui.rb', line 22

def initialize(env, shell)
  super(env)

  @shell = shell
end

Instance Method Details

#report_progress(progress, total, show_parts = true) ⇒ Object



45
46
47
48
49
50
51
52
# File 'lib/vagrant/ui.rb', line 45

def report_progress(progress, total, show_parts=true)
  percent = (progress.to_f / total.to_f) * 100
  line = "Progress: #{percent.to_i}%"
  line << " (#{progress} / #{total})" if show_parts
  line = "#{line_reset}#{line}"

  @shell.say(line, nil, false)
end