Class: GCI::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/gci/cli.rb

Constant Summary collapse

COMMANDS =
%i[generate root].freeze

Instance Method Summary collapse

Instance Method Details

#dispatch(command, options) ⇒ Object

Raises:



7
8
9
10
11
# File 'lib/gci/cli.rb', line 7

def dispatch(command, options)
  raise Error, "Invalid command '#{command}'" unless COMMANDS.include?(command.to_sym)

  public_send(command, options)
end

#generate(options) ⇒ Object



13
14
15
16
17
# File 'lib/gci/cli.rb', line 13

def generate(options)
  evaluate_user_config(options)

  GCI.pipeline.write
end

#root(options) ⇒ Object



19
20
21
22
23
# File 'lib/gci/cli.rb', line 19

def root(options)
  evaluate_user_config(options)

  GCI.root_pipeline.write
end