Module: Matt::Support::Puts

Included in:
Command, Participant
Defined in:
lib/matt/support/puts.rb

Instance Method Summary collapse

Instance Method Details

#debug(message) ⇒ Object



31
32
33
34
35
36
# File 'lib/matt/support/puts.rb', line 31

def debug(message)
  message = "#{self.to_s.ljust(30)} -- #{message}"
  return $stderr.puts(message) unless configuration
  return unless configuration.debug_level >= Configuration::DEBUG_VERBOSE
  puts_err(message)
end

#info(message) ⇒ Object



24
25
26
27
28
29
# File 'lib/matt/support/puts.rb', line 24

def info(message)
  message = "#{self.to_s.ljust(30)} -- #{message}"
  return $stderr.puts(message) unless configuration
  return unless configuration.debug_level >= Configuration::DEBUG_INFO
  puts_err(message)
end

#puts_err(*args, &bl) ⇒ Object



19
20
21
22
# File 'lib/matt/support/puts.rb', line 19

def puts_err(*args, &bl)
  return $stderr.puts(*args, &bl) unless configuration
  configuration.stderr.puts(*args, &bl)
end

#puts_out(*args, &bl) ⇒ Object Also known as: puts



13
14
15
16
# File 'lib/matt/support/puts.rb', line 13

def puts_out(*args, &bl)
  return $stdout.puts(*args, &bl) unless configuration
  configuration.stdout.puts(*args, &bl)
end

#stderrObject



9
10
11
# File 'lib/matt/support/puts.rb', line 9

def stderr
  configuration.stderr
end

#stdoutObject



5
6
7
# File 'lib/matt/support/puts.rb', line 5

def stdout
  configuration.stdout
end