Top Level Namespace

Defined Under Namespace

Modules: ApiSketch

Instance Method Summary collapse

Instance Method Details

#puts_error(message) ⇒ Object

Output error message to console.

Parameters:

  • message (String)

    message to output



18
19
20
21
# File 'lib/api_sketch/helpers.rb', line 18

def puts_error(message)
  $stderr.puts "\e[31m[ERROR] #{message}\e[0m" if ApiSketch::Config[:debug]
  exit(1)
end

#puts_info(message) ⇒ Object

Output info message to console.

Parameters:

  • message (String)

    message to output



4
5
6
# File 'lib/api_sketch/helpers.rb', line 4

def puts_info(message)
  $stdout.puts "\e[32m[INFO] #{message}\e[0m" if ApiSketch::Config[:debug]
end

#puts_warning(message) ⇒ Object

Output warning message to console.

Parameters:

  • message (String)

    message to output



11
12
13
# File 'lib/api_sketch/helpers.rb', line 11

def puts_warning(message)
  $stdout.puts "\e[33m[WARNING] #{message}\e[0m" if ApiSketch::Config[:debug]
end