Class: Thor::Shell::Basic

Inherits:
Object
  • Object
show all
Defined in:
lib/mkmatter.rb

Instance Method Summary collapse

Instance Method Details



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/mkmatter.rb', line 15

def print_wrapped(message, options = {})
  message.lstrip!
  message.gsub!(/\n\s+/, "\n")
  message = message.split("\n")
  message.each do |line|
    line.gsub!(/^------/, '      ') if line[0..5] == '------'
    line.gsub!(/^----/, '    ') if line[0..3] == '----'
    line.gsub!(/^--/, '  ') if line[0..1] == '--'
    stdout.puts line
  end
end