Module: Vimpack::Utils::Io

Included in:
Commands::Command, Process
Defined in:
lib/vimpack/utils/io.rb

Instance Method Summary collapse

Instance Method Details

#die!(message = nil) ⇒ Object



13
14
15
16
# File 'lib/vimpack/utils/io.rb', line 13

def die!(message=nil)
  scream(message)
  return Trollop::die USAGE
end

#exit_with_error!(message = nil, exit_code = 1) ⇒ Object



18
19
20
21
# File 'lib/vimpack/utils/io.rb', line 18

def exit_with_error!(message=nil, exit_code=1)
  scream(message) unless message.nil?
  exit(exit_code)
end

#say(message, color = :green) ⇒ Object



5
6
7
# File 'lib/vimpack/utils/io.rb', line 5

def say(message, color=:green)
  puts message.color(color) unless message.nil?
end

#scream(message) ⇒ Object



9
10
11
# File 'lib/vimpack/utils/io.rb', line 9

def scream(message)
  say(message, :red)
end