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