Class: Carrasco::CommandBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/carrasco/command_builder.rb

Instance Method Summary collapse

Instance Method Details

#from_config(config) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/carrasco/command_builder.rb', line 5

def from_config(config)
  config = Thor::CoreExt::HashWithIndifferentAccess.new(config)
  klass = Class.new(Thor)

  build_commands(config[:commands] || [], klass)
  build_grups(config[:groups] || [], klass)

  klass
end