Module: BuildTool::StateHelper::ClassMethods
- Defined in:
- lib/build-tool/state_helper.rb
Instance Method Summary collapse
Instance Method Details
#state_char(state) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/build-tool/state_helper.rb', line 40 def state_char( state ) case state when STARTED "R" when CANCELED_BY_USER ANSI::Code.red { "C" } when FINISHED_SUCCESSFUL ANSI::Code.green { "S" } when FINISHED_WITH_ERRORS ANSI::Code.red { "E" } else "#{state.to_s}?" end end |
#state_str(state) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/build-tool/state_helper.rb', line 25 def state_str( state ) case state when STARTED "STARTED" when CANCELED_BY_USER ANSI::Code.red { "CANCELED" } when FINISHED_SUCCESSFUL ANSI::Code.green { "SUCCESS" } when FINISHED_WITH_ERRORS ANSI::Code.red { "ERRORS" } else "#{state.to_s}?" end end |