Class: Orats::CLI
- Inherits:
-
Thor
- Object
- Thor
- Orats::CLI
- Defined in:
- lib/orats/cli.rb
Overview
the thor driven command line interface
Instance Method Summary collapse
-
#initialize(args, local_options, config) ⇒ CLI
constructor
for now none of the code below is in action and the readme explicitly says you can only store the postgres and redis credentials since the args only get inserted into the new and nuke commands.
- #new(target_path) ⇒ Object
- #nuke(target_path) ⇒ Object
- #templates ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(args, local_options, config) ⇒ CLI
for now none of the code below is in action and the readme explicitly says you can only store the postgres and redis credentials since the args only get inserted into the new and nuke commands
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/orats/cli.rb', line 26 def initialize(args, , config) super = [] config[:current_command]..each do |key| aliases = key[1].aliases option = key[0].to_s.gsub('_', '-') aliases.each do |item| << item if .join.include?(item) end << option if .include?("--#{option}") end end |
Instance Method Details
#new(target_path) ⇒ Object
57 58 59 |
# File 'lib/orats/cli.rb', line 57 def new(target_path) Commands::New::Exec.new(target_path, ).init end |
#nuke(target_path) ⇒ Object
72 73 74 |
# File 'lib/orats/cli.rb', line 72 def nuke(target_path) Commands::Nuke.new(target_path, ).init end |
#templates ⇒ Object
78 79 80 |
# File 'lib/orats/cli.rb', line 78 def templates Commands::New::Exec.new.available_templates end |
#version ⇒ Object
84 85 86 |
# File 'lib/orats/cli.rb', line 84 def version puts "Orats version #{VERSION}" end |