Module: GFSM::Output::Methods

Included in:
GFSM::Output, GFSM::Output
Defined in:
lib/tools/output.rb

Instance Method Summary collapse

Instance Method Details

#error(message) ⇒ Object



34
35
36
# File 'lib/tools/output.rb', line 34

def error(message)
  puts("ERROR: #{message}", stderr: true)
end

#info(message) ⇒ Object



26
27
28
# File 'lib/tools/output.rb', line 26

def info(message)
  puts(message)
end


18
19
20
# File 'lib/tools/output.rb', line 18

def print(message = nil, stderr: false)
  stderr ? stderr_handle.print(message) : stdout_handle.print(message)
end

#puts(message = nil, stderr: false) ⇒ Object



22
23
24
# File 'lib/tools/output.rb', line 22

def puts(message = nil, stderr: false)
  stderr ? stderr_handle.puts(message) : stdout_handle.puts(message)
end

#stderr_handleObject



14
15
16
# File 'lib/tools/output.rb', line 14

def stderr_handle
  $stderr.tap { |handle| handle.sync = true }
end

#stdout_handleObject



10
11
12
# File 'lib/tools/output.rb', line 10

def stdout_handle
  $stdout.tap { |handle| handle.sync = true }
end

#success(message) ⇒ Object



38
39
40
# File 'lib/tools/output.rb', line 38

def success(message)
  puts(message)
end

#warn(message) ⇒ Object



30
31
32
# File 'lib/tools/output.rb', line 30

def warn(message)
  puts("WARNING: #{message}", stderr: true)
end