Class: Vines::CLI
- Inherits:
-
Object
- Object
- Vines::CLI
- Defined in:
- lib/vines/cli.rb
Overview
The command line application that’s invoked by the ‘vines` binary included in the gem. Parses the command line arguments to create a new server directory, and starts and stops the server.
Constant Summary collapse
- COMMANDS =
%w[start stop restart init bcrypt cert ldap schema]
Class Method Summary collapse
Instance Method Summary collapse
-
#start ⇒ Object
Run the command line application to parse arguments and run sub-commands.
Class Method Details
.start ⇒ Object
8 9 10 |
# File 'lib/vines/cli.rb', line 8 def self.start self.new.start end |
Instance Method Details
#start ⇒ Object
Run the command line application to parse arguments and run sub-commands. Exits the process with a non-zero return code to indicate failure.
Returns nothing.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/vines/cli.rb', line 16 def start register_storage opts = parse(ARGV) check_config(opts) command = Command.const_get(opts[:command].capitalize).new begin command.run(opts) rescue SystemExit # do nothing rescue Exception => e puts e. exit(1) end end |