Module: ShellOpts::Messages

Defined in:
lib/shellopts.rb

Overview

The Include module brings the reporting methods into the namespace when included

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.includeObject



321
322
323
324
# File 'lib/shellopts.rb', line 321

def self.include(...)
  @is_included = true
  super
end

.is_included?Boolean



320
# File 'lib/shellopts.rb', line 320

def self.is_included?() @is_included end

Instance Method Details

#debug(message) ⇒ Object



338
339
340
# File 'lib/shellopts.rb', line 338

def debug(message)
  $stdout.puts message if debug?
end

#mesg(message) ⇒ Object



330
331
332
# File 'lib/shellopts.rb', line 330

def mesg(message)
  $stdout.puts message if !quiet?
end

#notice(message) ⇒ Object



326
327
328
# File 'lib/shellopts.rb', line 326

def notice(message)
  $stderr.puts "#{name}: #{message}" if !quiet?
end

#verb(level = 1, message) ⇒ Object



334
335
336
# File 'lib/shellopts.rb', line 334

def verb(level = 1, message)
  $stdout.puts message if level <= @verbose
end