Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/one_helper/onevm_helper.rb,
lib/command_parser.rb

Overview

colored strings

Instance Method Summary collapse

Instance Method Details

#greenObject



40
41
42
# File 'lib/one_helper/onevm_helper.rb', line 40

def green
    colorize(32)
end

#redObject



36
37
38
# File 'lib/one_helper/onevm_helper.rb', line 36

def red
    colorize(31)
end

#unindent(spaces = nil) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/command_parser.rb', line 21

def unindent(spaces=nil)
    unless spaces
        m = self.match(/^(\s*)/)
        spaces = m[1].size
    end

    self.gsub!(/^ {#{spaces}}/, '')
end