Class: VagrantPlugins::TrellisSequel::Command::Root
- Inherits:
-
Object
- Object
- VagrantPlugins::TrellisSequel::Command::Root
- Defined in:
- lib/vagrant_plugins/trellis_sequel/command/root.rb
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(argv, env) ⇒ Root
constructor
A new instance of Root.
Constructor Details
#initialize(argv, env) ⇒ Root
Returns a new instance of Root.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/vagrant_plugins/trellis_sequel/command/root.rb', line 13 def initialize(argv, env) super @main_args, @sub_command, @sub_args = split_main_and_subcommand(argv) @subcommands = Vagrant::Registry.new @subcommands.register(:open) do require_relative 'open' Open end end |
Class Method Details
.synopsis ⇒ Object
9 10 11 |
# File 'lib/vagrant_plugins/trellis_sequel/command/root.rb', line 9 def self.synopsis 'open Trellis databases in Sequel Pro' end |
Instance Method Details
#execute ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/vagrant_plugins/trellis_sequel/command/root.rb', line 26 def execute return help if help? || !sub_command? # Initialize and execute the command class @subcommands.get(@sub_command&.to_sym) .new(@sub_args, @env) .execute rescue Vagrant::Errors::VagrantError => e raise e rescue StandardError => e raise Vagrant::Errors::CLIInvalidUsage, help: "#{e.}\r\n\r\nBacktrace:\r\n#{e.backtrace&.join("\r\n")}" end |