Class: Hudson::Installation::Progress
- Defined in:
- lib/hudson/installation.rb
Defined Under Namespace
Classes: Ok
Instance Attribute Summary collapse
-
#aborted ⇒ Object
readonly
Returns the value of attribute aborted.
Instance Method Summary collapse
-
#initialize ⇒ Progress
constructor
A new instance of Progress.
- #means(step) ⇒ Object
- #ok(msg = nil) ⇒ Object
Constructor Details
#initialize ⇒ Progress
Returns a new instance of Progress.
107 108 109 110 |
# File 'lib/hudson/installation.rb', line 107 def initialize @shell = Thor::Shell::Color.new @aborted = false end |
Instance Attribute Details
#aborted ⇒ Object (readonly)
Returns the value of attribute aborted.
106 107 108 |
# File 'lib/hudson/installation.rb', line 106 def aborted @aborted end |
Instance Method Details
#means(step) ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/hudson/installation.rb', line 112 def means(step) return if @aborted begin @shell.say(step + "... ") yield(self).tap do @shell.say("[OK]", :green) end rescue Ok => ok @shell.say("[OK#{ok. ? " - #{ok.}" : ''}]", :green) rescue StandardError => e @shell.say("[FAIL - #{e.}]", :red) @aborted = true false end end |