Sha256: a57f3845f66b0929cd7b68379c0fb1fdf5b0fb6ce14c9b59063b29a251a3538d

Contents?: true

Size: 570 Bytes

Versions: 6

Compression:

Stored size: 570 Bytes

Contents

module Serverspec
  module 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
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
serverspec-2.0.0.beta19 lib/serverspec/type/process.rb
serverspec-2.0.0.beta18 lib/serverspec/type/process.rb
serverspec-2.0.0.beta17 lib/serverspec/type/process.rb
serverspec-2.0.0.beta16 lib/serverspec/type/process.rb
serverspec-2.0.0.beta15 lib/serverspec/type/process.rb
serverspec-2.0.0.beta14 lib/serverspec/type/process.rb