Top Level Namespace
Defined Under Namespace
Modules: Calamum
Instance Method Summary collapse
-
#pj(json, indent = ' ') ⇒ String
Returns a formatted JSON string.
-
#puts_error(msg) ⇒ Object
Output error message to console.
-
#puts_info(msg) ⇒ Object
Output info message to console.
-
#puts_warning(msg) ⇒ Object
Output warning message to console.
Instance Method Details
#pj(json, indent = ' ') ⇒ String
Returns a formatted JSON string.
6 7 8 9 |
# File 'lib/calamum/helpers.rb', line 6 def pj(json, indent = ' ') require 'json' JSON.pretty_generate(json, :indent => indent * 4).gsub!(/\n/, '<br/>') end |
#puts_error(msg) ⇒ Object
Output error message to console.
28 29 30 31 |
# File 'lib/calamum/helpers.rb', line 28 def puts_error(msg) $stderr.puts "\e[31m[ERROR] #{msg}\e[0m" if Calamum::Config[:debug] exit(1) end |