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
340 341 342 343 |
# File 'lib/shellopts.rb', line 340 def self.include(...) @is_included = true super end |
.is_included? ⇒ Boolean
339 |
# File 'lib/shellopts.rb', line 339 def self.is_included?() @is_included end |
Instance Method Details
#debug(message) ⇒ Object
357 358 359 |
# File 'lib/shellopts.rb', line 357 def debug() $stdout.puts if debug? end |
#mesg(message) ⇒ Object
349 350 351 |
# File 'lib/shellopts.rb', line 349 def mesg() $stdout.puts if !quiet? end |
#notice(message) ⇒ Object
345 346 347 |
# File 'lib/shellopts.rb', line 345 def notice() $stderr.puts "#{name}: #{message}" if !quiet? end |
#verb(level = 1, message) ⇒ Object
353 354 355 |
# File 'lib/shellopts.rb', line 353 def verb(level = 1, ) $stdout.puts if level <= @verbose end |