File: fusion.rb

package info (click to toggle)
ruby-fission 0.5.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 624 kB
  • sloc: ruby: 4,664; makefile: 10
file content (20 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Fission
  class Fusion

    # Public: Determines if the VMware Fusion GUI application is running.
    #
    # Examples
    #
    #   Fission::Fusion.running?
    #   # => true
    #
    # Returns a Boolean.
    def self.running?
      command = "ps -ef | grep -v grep | grep -c "
      command << "'#{Fission.config['gui_bin']}' 2>&1"
      command_executor = Fission::Action::ShellExecutor.new command
      command_executor.execute['output'].strip.to_i > 0
    end

  end
end