Class: Shanty::Cli

Inherits:
Object
  • Object
show all
Includes:
Commander::Methods
Defined in:
lib/shanty/cli.rb

Overview

Public: Handle the CLI interface between the user and the registered tasks and plugins.

Instance Method Summary collapse

Constructor Details

#initialize(task_env) ⇒ Cli

Returns a new instance of Cli.



11
12
13
# File 'lib/shanty/cli.rb', line 11

def initialize(task_env)
  @task_env = task_env
end

Instance Method Details

#runObject



21
22
23
24
25
26
27
28
# File 'lib/shanty/cli.rb', line 21

def run
  program :name, 'Shanty'
  program :version, '0.1.0'
  program :description, 'Something'

  setup_tasks
  run!
end

#tasksObject



15
16
17
18
19
# File 'lib/shanty/cli.rb', line 15

def tasks
  TaskSet.task_sets.reduce({}) do |acc, task_set|
    acc.merge(task_set.tasks)
  end
end