module ErrorHandling

Public Class Methods

cant_find(file_name) click to toggle source
# File lib/datafarming/error_handling.rb, line 20
def self.cant_find(file_name)
  clean_abort [
    'ERROR: Cannot find file '.red + file_name.yellow, '',
    'Correct this by installing ' + file_name.yellow + ' into the same',
    'directory location as ' + prog_name.yellow + '.'
  ]
end
clean_abort(msg_array) click to toggle source
# File lib/datafarming/error_handling.rb, line 11
def self.clean_abort(msg_array)
  message(msg_array)
  exit
end
message(msg_array) click to toggle source
# File lib/datafarming/error_handling.rb, line 5
def self.message(msg_array)
  STDERR.puts
  msg_array.each { |line| STDERR.puts line }
  STDERR.puts
end
prog_name() click to toggle source
# File lib/datafarming/error_handling.rb, line 16
def self.prog_name
  $PROGRAM_NAME.split(%r{/|\\})[-1]
end