Class: Vagrant::UI::Shell
- Inherits:
-
Vagrant::UI
- Object
- Vagrant::UI
- Vagrant::UI::Shell
- 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
Instance Method Summary collapse
-
#initialize(env, shell) ⇒ Shell
constructor
A new instance of Shell.
- #report_progress(progress, total, show_parts = true) ⇒ Object
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 |