Sha256: 8d2a40a7ac5b8cb719fc41c60460c817aedc9051c7fa4fc144caeed1cf8cd32b

Contents?: true

Size: 514 Bytes

Versions: 45

Compression:

Stored size: 514 Bytes

Contents

module Serverspec::Type
  class Process < Base
    def running?
      pid = @runner.get_process(@name, :format => "pid=").stdout
      not pid.empty?
    end

    def user
      get_column("user")
    end

    def group
      get_column("group")
    end

    def method_missing(meth)
      get_column(meth.to_s)
    end

    def get_column(keyword)
      ret = @runner.get_process(@name, :format => "#{keyword}=")
      val = ret.stdout.strip
      val = val.to_i if val.match(/^\d+$/)
      val
    end
  end
end

Version data entries

45 entries across 45 versions & 3 rubygems

Version Path
serverspec-2.12.0 lib/serverspec/type/process.rb
serverspec-2.11.0 lib/serverspec/type/process.rb
serverspec-2.10.2 lib/serverspec/type/process.rb
serverspec-2.10.1 lib/serverspec/type/process.rb
serverspec-2.10.0 lib/serverspec/type/process.rb
serverspec-2.9.1 lib/serverspec/type/process.rb
serverspec-2.9.0 lib/serverspec/type/process.rb
serverspec-2.8.2 lib/serverspec/type/process.rb
serverspec-2.8.1 lib/serverspec/type/process.rb
serverspec-2.8.0 lib/serverspec/type/process.rb
serverspec-2.7.2 lib/serverspec/type/process.rb
serverspec-2.7.1 lib/serverspec/type/process.rb
serverspec-2.7.0 lib/serverspec/type/process.rb
serverspec-2.6.0 lib/serverspec/type/process.rb
serverspec-2.5.0 lib/serverspec/type/process.rb
serverspec-2.4.0 lib/serverspec/type/process.rb
serverspec-2.3.1 lib/serverspec/type/process.rb
serverspec-2.3.0 lib/serverspec/type/process.rb
serverspec-2.2.0 lib/serverspec/type/process.rb
serverspec-clc-2.1.0 lib/serverspec/type/process.rb