Class: VagrantPlugins::Ebcommon::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-ebcommon/commands/stop-selenium.rb,
lib/vagrant-ebcommon/commands/start-selenium.rb,
lib/vagrant-ebcommon/commands/clear_requirements_cache.rb

Instance Method Summary collapse

Instance Method Details

#executeObject

Raises:

  • (Vagrant::Errors::CLIInvalidUsage)


5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/vagrant-ebcommon/commands/stop-selenium.rb', line 5

def execute

  opts = OptionParser.new do |o|
    o.banner = 'Usage: vagrant start-selenium [-h]'
    o.separator ''
    o.separator 'Will shutdown selenium on the host machine'
  end
  argv = parse_options opts
  return if !argv
  raise Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length > 0

  system "kill $(ps aux | grep '[s]elenium-server-standalone' | awk '{print $2}') > /dev/null 2>&1"
  @env.ui.success 'Selenium server stopped!'
end