Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/command_parser.rb,
lib/one_helper/onevm_helper.rb
Overview
colored strings
Instance Method Summary collapse
- #green ⇒ Object
- #red ⇒ Object
-
#unindent(spaces = nil) ⇒ Object
Unindent the string by removing leading spaces.
Instance Method Details
#green ⇒ Object
44 45 46 |
# File 'lib/one_helper/onevm_helper.rb', line 44 def green colorize(32) end |
#red ⇒ Object
40 41 42 |
# File 'lib/one_helper/onevm_helper.rb', line 40 def red colorize(31) end |
#unindent(spaces = nil) ⇒ Object
Unindent the string by removing leading spaces.
26 27 28 29 30 31 32 33 |
# File 'lib/command_parser.rb', line 26 def unindent(spaces = nil) unless spaces m = match(/^(\s*)/) spaces = m[1].size end gsub!(/^ {#{spaces}}/, '') end |