Class: Cheese::Verbose
- Inherits:
-
Object
- Object
- Cheese::Verbose
- Defined in:
- lib/verbose.rb
Overview
This is a wrapper around actions that can be taken, it allows you to control the verbosity and also ‘fake’ an action on a dry run.
Constant Summary collapse
- @@loud =
false
- @@dry_run =
false
Class Method Summary collapse
Class Method Details
.dry_run=(enable = true) ⇒ Object
30 31 32 33 |
# File 'lib/verbose.rb', line 30 def self.dry_run=(enable=true) @@dry_run = enable @@loud = enable end |
.log_task(message = "") ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/verbose.rb', line 9 def self.log_task(="") if block_given? if @@dry_run if @@loud puts "faking: #{}" puts "done" end else puts "doing: #{}" if @@loud yield puts "done" if @@loud end else puts if @@loud end end |
.loud=(enable = true) ⇒ Object
26 27 28 |
# File 'lib/verbose.rb', line 26 def self.loud=(enable=true) @@loud = enable end |