Module: Mines::Utilities

Extended by:
Utilities
Included in:
Utilities
Defined in:
lib/utilities.rb

Instance Method Summary collapse

Instance Method Details



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/utilities.rb', line 93

def print_command(command, text)
  width = Integer(`tput cols`) - 22
  sum = 0
  print "  "+command.ljust(20).blue.bold
  text.split.each do |word|
    if (sum + word.size >= width)
      puts ""
      print "".ljust 22
      sum=0
    end   
    sum+=word.size+1
    print " "
    print word  
  end # end text.split
  puts ""
end