Class: Message::Error
- Inherits:
-
Object
- Object
- Message::Error
- Defined in:
- lib/source_press/message.rb
Overview
Outputs errors to the command line
Class Method Summary collapse
-
.error_puts(message, errors = nil) ⇒ Object
Print error message.
- .no_file(type, file, extra = "") ⇒ Object
- .no_files(errors = nil) ⇒ Object
Class Method Details
.error_puts(message, errors = nil) ⇒ Object
Print error message
20 21 22 23 24 25 |
# File 'lib/source_press/message.rb', line 20 def self.error_puts(, errors = nil) puts "\nError: #{}" errors&.each { |e| puts " - " << e } exit # Fatal error, exit program end |
.no_file(type, file, extra = "") ⇒ Object
14 15 16 17 |
# File 'lib/source_press/message.rb', line 14 def self.no_file(type, file, extra = "") msg = "Could not load #{type} file, #{file}" error_puts(msg << "\n " << extra) end |
.no_files(errors = nil) ⇒ Object
9 10 11 12 |
# File 'lib/source_press/message.rb', line 9 def self.no_files(errors = nil) msg = "Could not load file(s):" error_puts(msg, errors) end |