Class: Freighthop::CLI::Vagrant
- Inherits:
-
Object
- Object
- Freighthop::CLI::Vagrant
- Defined in:
- lib/freighthop/cli/vagrant.rb
Constant Summary collapse
- COMMANDS =
%w[ up halt destroy provision reload status ]
Class Method Summary collapse
Instance Method Summary collapse
- #args ⇒ Object
-
#initialize(*args) ⇒ Vagrant
constructor
A new instance of Vagrant.
- #run ⇒ Object
Constructor Details
#initialize(*args) ⇒ Vagrant
Returns a new instance of Vagrant.
15 16 17 |
# File 'lib/freighthop/cli/vagrant.rb', line 15 def initialize(*args) @subcommand, @rest = args end |
Class Method Details
.match?(*args) ⇒ Boolean
11 12 13 |
# File 'lib/freighthop/cli/vagrant.rb', line 11 def self.match?(*args) COMMANDS.include?(args.first) end |
Instance Method Details
#args ⇒ Object
19 20 21 |
# File 'lib/freighthop/cli/vagrant.rb', line 19 def args ([*@rest] || []).join(' ') end |
#run ⇒ Object
23 24 25 26 |
# File 'lib/freighthop/cli/vagrant.rb', line 23 def run Freighthop::CLI::Checks.ensure_config_exists! exec %Q(vagrant #{@subcommand} #{args}) end |