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
- #debug(message) ⇒ Object
- #mesg(message) ⇒ Object
- #notice(message) ⇒ Object
- #verb(level = 1, message) ⇒ Object
Class Method Details
.include ⇒ Object
352 353 354 355 |
# File 'lib/shellopts.rb', line 352 def self.include(...) @is_included = true super end |
.is_included? ⇒ Boolean
351 |
# File 'lib/shellopts.rb', line 351 def self.is_included?() @is_included end |
Instance Method Details
#debug(message) ⇒ Object
369 370 371 |
# File 'lib/shellopts.rb', line 369 def debug() $stdout.puts if debug? end |
#mesg(message) ⇒ Object
361 362 363 |
# File 'lib/shellopts.rb', line 361 def mesg() $stdout.puts if !quiet? end |
#notice(message) ⇒ Object
357 358 359 |
# File 'lib/shellopts.rb', line 357 def notice() $stderr.puts "#{name}: #{message}" if !quiet? end |
#verb(level = 1, message) ⇒ Object
365 366 367 |
# File 'lib/shellopts.rb', line 365 def verb(level = 1, ) $stdout.puts if level <= @verbose end |