Sha256: 64746ae769f0080554f1fe2bd782ab310ed273088620c0316b2354b2fd3e145e

Contents?: true

Size: 535 Bytes

Versions: 5

Compression:

Stored size: 535 Bytes

Contents

require 'vapir-ie/browser'

module Vapir
  module Process
    
    # Returns the number of windows processes running with the specified name.
    def self.count name
      mgmt = WIN32OLE.connect('winmgmts:\\\\.')
      processes = mgmt.InstancesOf('win32_process')
      processes.extend Enumerable
      processes.select{|x| x.name == name}.length
    end
    
  end
  
  class IE
    # Returns the number of IEXPLORE processes currently running.
    def self.process_count
      Vapir::Process.count 'iexplore.exe'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vapir-ie-1.10.1 lib/vapir-ie/process.rb
vapir-ie-1.10.0 lib/vapir-ie/process.rb
vapir-ie-1.9.0 lib/vapir-ie/process.rb
vapir-ie-1.8.1 lib/vapir-ie/process.rb
vapir-ie-1.8.0 lib/vapir-ie/process.rb