Sha256: fd54e308e05747d9d92603d013834e07e1c28478f7c565f80615a9faf574bef1

Contents?: true

Size: 592 Bytes

Versions: 11

Compression:

Stored size: 592 Bytes

Contents

module Serverspec
  module Type
    class Process < Base
      def running?
        pid = @runner.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 = @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

11 entries across 11 versions & 1 rubygems

Version Path
serverspec-2.0.0.beta13 lib/serverspec/type/process.rb
serverspec-2.0.0.beta12 lib/serverspec/type/process.rb
serverspec-2.0.0.beta11 lib/serverspec/type/process.rb
serverspec-2.0.0.beta10 lib/serverspec/type/process.rb
serverspec-2.0.0.beta9 lib/serverspec/type/process.rb
serverspec-2.0.0.beta8 lib/serverspec/type/process.rb
serverspec-2.0.0.beta7 lib/serverspec/type/process.rb
serverspec-2.0.0.beta6 lib/serverspec/type/process.rb
serverspec-2.0.0.beta5 lib/serverspec/type/process.rb
serverspec-2.0.0.beta4 lib/serverspec/type/process.rb
serverspec-2.0.0.beta3 lib/serverspec/type/process.rb