Module: GFSM::Output::Methods
- Included in:
- GFSM::Output, GFSM::Output
- Defined in:
- lib/tools/output.rb
Instance Method Summary collapse
- #error(message) ⇒ Object
- #info(message) ⇒ Object
- #print(message = nil, stderr: false) ⇒ Object
- #puts(message = nil, stderr: false) ⇒ Object
- #stderr_handle ⇒ Object
- #stdout_handle ⇒ Object
- #success(message) ⇒ Object
- #warn(message) ⇒ Object
Instance Method Details
#error(message) ⇒ Object
34 35 36 |
# File 'lib/tools/output.rb', line 34 def error() puts("ERROR: #{}", stderr: true) end |
#info(message) ⇒ Object
26 27 28 |
# File 'lib/tools/output.rb', line 26 def info() puts() end |
#print(message = nil, stderr: false) ⇒ Object
18 19 20 |
# File 'lib/tools/output.rb', line 18 def print( = nil, stderr: false) stderr ? stderr_handle.print() : stdout_handle.print() end |
#puts(message = nil, stderr: false) ⇒ Object
22 23 24 |
# File 'lib/tools/output.rb', line 22 def puts( = nil, stderr: false) stderr ? stderr_handle.puts() : stdout_handle.puts() end |
#stderr_handle ⇒ Object
14 15 16 |
# File 'lib/tools/output.rb', line 14 def stderr_handle $stderr.tap { |handle| handle.sync = true } end |
#stdout_handle ⇒ Object
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() puts() end |
#warn(message) ⇒ Object
30 31 32 |
# File 'lib/tools/output.rb', line 30 def warn() puts("WARNING: #{}", stderr: true) end |