Module: Befog::Commands::Mixins::Traceable

Included in:
Add
Defined in:
lib/befog/commands/mixins/traceable.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(target) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/befog/commands/mixins/traceable.rb', line 5

def self.included(target)
  target.module_eval do
    option :rehearse,
      :short => :u,
      :description => "Dry-run, verbose logging, but don't actually run anything"
  end
end

Instance Method Details

#rehearse?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/befog/commands/mixins/traceable.rb', line 13

def rehearse?
  !!options[:rehearse]
end

#verbose(message) ⇒ Object



21
22
23
# File 'lib/befog/commands/mixins/traceable.rb', line 21

def verbose(message)
  log(message) if verbose?
end

#verbose?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/befog/commands/mixins/traceable.rb', line 17

def verbose?
  !!options[:verbose] or rehearse?
end