Sha256: ce9f306d2ee6492219c5f516efcb4073152170a79384622063dc440843294b5f

Contents?: true

Size: 542 Bytes

Versions: 159

Compression:

Stored size: 542 Bytes

Contents

class Specinfra::Command::Base::Process < Specinfra::Command::Base
  class << self
    def get(process, opts)
      "ps -C #{escape(process)} -o #{opts[:format]} | head -1"
    end

    def count(process)
      "ps aux | grep -w -- #{escape(process)} | grep -v grep | wc -l"
    end

    def check_is_running(process)
      "ps aux | grep -w -- #{escape(process)} | grep -qv grep"
    end

    def check_count(process,count)
      "test $(ps aux | grep -w -- #{escape(process)} | grep -v grep | wc -l) -eq #{escape(count)}"
    end
  end
end

Version data entries

159 entries across 159 versions & 1 rubygems

Version Path
specinfra-2.70.2 lib/specinfra/command/base/process.rb
specinfra-2.70.1 lib/specinfra/command/base/process.rb
specinfra-2.70.0 lib/specinfra/command/base/process.rb
specinfra-2.69.0 lib/specinfra/command/base/process.rb
specinfra-2.68.2 lib/specinfra/command/base/process.rb
specinfra-2.68.1 lib/specinfra/command/base/process.rb
specinfra-2.68.0 lib/specinfra/command/base/process.rb
specinfra-2.67.10 lib/specinfra/command/base/process.rb
specinfra-2.67.9 lib/specinfra/command/base/process.rb
specinfra-2.67.8 lib/specinfra/command/base/process.rb
specinfra-2.67.7 lib/specinfra/command/base/process.rb
specinfra-2.67.6 lib/specinfra/command/base/process.rb
specinfra-2.67.5 lib/specinfra/command/base/process.rb
specinfra-2.67.3 lib/specinfra/command/base/process.rb
specinfra-2.67.2 lib/specinfra/command/base/process.rb
specinfra-2.67.1 lib/specinfra/command/base/process.rb
specinfra-2.67.0 lib/specinfra/command/base/process.rb
specinfra-2.66.9 lib/specinfra/command/base/process.rb
specinfra-2.66.8 lib/specinfra/command/base/process.rb
specinfra-2.66.7 lib/specinfra/command/base/process.rb