Module: Drakkon::Skeleton::CLI
- Defined in:
- lib/drakkon/skeleton/cli.rb
Overview
Run Command for CLI
Class Method Summary collapse
- .args(raw = []) ⇒ Object
-
.init!(raw) ⇒ Object
General Run.
- .menu ⇒ Object
- .prompt ⇒ Object
- .start(cmd) ⇒ Object
Class Method Details
.args(raw = []) ⇒ Object
5 6 7 8 9 |
# File 'lib/drakkon/skeleton/cli.rb', line 5 def self.args(raw = []) @args ||= raw @args end |
.init!(raw) ⇒ Object
General Run
12 13 14 15 16 17 |
# File 'lib/drakkon/skeleton/cli.rb', line 12 def self.init!(raw) args(raw) cmd = args.shift start(cmd&.to_sym) end |
.menu ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/drakkon/skeleton/cli.rb', line 33 def self. prompt.select('Wat do?', filter: true) do || .choice name: 'install (New Templates)', value: :install .choice name: 'deploy', value: :deploy if Hub.skeletons? end rescue TTY::Reader::InputInterrupt exit 0 end |
.prompt ⇒ Object
29 30 31 |
# File 'lib/drakkon/skeleton/cli.rb', line 29 def self.prompt TTY::Prompt.new(active_color: :cyan, interrupt: :exit) end |