Sha256: bddc0ce37c3b17fdc24001b4d0d40da63d41281cf76dea044bb423ec4cef1298

Contents?: true

Size: 592 Bytes

Versions: 22

Compression:

Stored size: 592 Bytes

Contents

module Serverspec
  module Type
    class Process < Base
      def running?
        pid = backend.run_command(commands.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 = backend.get_process(@name, :format => "#{keyword}=")
        val = ret.stdout.strip
        val = val.to_i if val.match(/^\d+$/)
        val
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
serverspec-1.16.0 lib/serverspec/type/process.rb
serverspec-1.15.0 lib/serverspec/type/process.rb
serverspec-1.14.0 lib/serverspec/type/process.rb
serverspec-1.13.0 lib/serverspec/type/process.rb
serverspec-1.12.0 lib/serverspec/type/process.rb
serverspec-1.11.0 lib/serverspec/type/process.rb
serverspec-1.10.0 lib/serverspec/type/process.rb
serverspec-1.9.1 lib/serverspec/type/process.rb
serverspec-1.9.0 lib/serverspec/type/process.rb
serverspec-1.8.0 lib/serverspec/type/process.rb
serverspec-1.7.1 lib/serverspec/type/process.rb
serverspec-1.7.0 lib/serverspec/type/process.rb
serverspec-1.6.0 lib/serverspec/type/process.rb
serverspec-1.5.0 lib/serverspec/type/process.rb
serverspec-2.0.0.beta2 lib/serverspec/type/process.rb
serverspec-1.4.2 lib/serverspec/type/process.rb
serverspec-2.0.0.beta1 lib/serverspec/type/process.rb
serverspec-1.4.1 lib/serverspec/type/process.rb
serverspec-1.4.0 lib/serverspec/type/process.rb
serverspec-1.3.0 lib/serverspec/type/process.rb