Method: Common::Color#align_right

Defined in:
lib/common/color.rb

#align_right(length, console_length) ⇒ Object

Align a message (OK, FAIL, WARN) to the right.

Parameters:

  • length

    The length to a line of the bash screen

  • console_length

    The length of the console

Author:

  • tmarmin



209
210
211
212
213
214
215
216
217
218
219
# File 'lib/common/color.rb', line 209

def align_right(length, console_length)
  nb_spaces_to_print=console_length.to_i - length - 1

  i=0
  str=""
  while i < nb_spaces_to_print do
    str+=" "
    i+=1
  end
  return str
end