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-ruby19-2.24.3 lib/serverspec/type/process.rb
serverspec-2.24.3 lib/serverspec/type/process.rb
serverspec-2.24.2 lib/serverspec/type/process.rb
serverspec-2.24.1 lib/serverspec/type/process.rb
serverspec-2.24.0 lib/serverspec/type/process.rb
serverspec-2.23.1 lib/serverspec/type/process.rb
serverspec-2.23.0 lib/serverspec/type/process.rb
serverspec-2.22.0 lib/serverspec/type/process.rb
serverspec-2.21.1 lib/serverspec/type/process.rb
serverspec-2.21.0 lib/serverspec/type/process.rb
serverspec-2.20.0 lib/serverspec/type/process.rb
serverspec-2.19.0 lib/serverspec/type/process.rb
serverspec-2.18.0 lib/serverspec/type/process.rb
serverspec-2.17.1 lib/serverspec/type/process.rb
serverspec-2.17.0 lib/serverspec/type/process.rb
serverspec-2.16.0 lib/serverspec/type/process.rb
serverspec-2.15.0 lib/serverspec/type/process.rb
serverspec-2.14.1 lib/serverspec/type/process.rb
serverspec-2.14.0 lib/serverspec/type/process.rb
serverspec-2.13.0 lib/serverspec/type/process.rb