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
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() $stdout.puts if debug? end |
#mesg(message) ⇒ Object
330 331 332 |
# File 'lib/shellopts.rb', line 330 def mesg() $stdout.puts if !quiet? end |
#notice(message) ⇒ Object
326 327 328 |
# File 'lib/shellopts.rb', line 326 def notice() $stderr.puts "#{name}: #{}" if !quiet? end |
#verb(level = 1, message) ⇒ Object
334 335 336 |
# File 'lib/shellopts.rb', line 334 def verb(level = 1, ) $stdout.puts if level <= @verbose end |