Method: Thor::Actions#initialize

Defined in:
lib/wtch/vendor/thor/actions.rb

#initialize(args = [], options = {}, config = {}) ⇒ Object

Extends initializer to add more configuration options.

Configuration

behavior<Symbol>

The actions default behavior. Can be :invoke or :revoke. It also accepts :force, :skip and :pretend to set the behavior and the respective option.

destination_root<String>

The root directory needed for some actions.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/wtch/vendor/thor/actions.rb', line 72

def initialize(args=[], options={}, config={})
  self.behavior = case config[:behavior].to_s
    when "force", "skip"
      _cleanup_options_and_set(options, config[:behavior])
      :invoke
    when "revoke"
      :revoke
    else
      :invoke
  end

  super
  self.destination_root = config[:destination_root]
end