Class: Freighthop::CLI
- Inherits:
-
Object
- Object
- Freighthop::CLI
- Defined in:
- lib/freighthop/cli.rb,
lib/freighthop/cli.rb
Defined Under Namespace
Classes: Checks, Help, Init, SSH, Vagrant, Version
Constant Summary collapse
- COMMANDS =
[ Freighthop::CLI::Version, Freighthop::CLI::Help, Freighthop::CLI::Init, Freighthop::CLI::Vagrant, Freighthop::CLI::SSH ]
Instance Method Summary collapse
-
#initialize(*args) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(*args) ⇒ CLI
Returns a new instance of CLI.
19 20 21 |
# File 'lib/freighthop/cli.rb', line 19 def initialize(*args) @args = args end |
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/freighthop/cli.rb', line 23 def run Freighthop::VagrantEnv.activate! command = COMMANDS.detect { |c| c.match?(*@args) } # no need for a nil check, because CLI::SSH will always match command.new(*@args).run end |