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.82.25 lib/specinfra/command/base/process.rb
specinfra-2.82.24 lib/specinfra/command/base/process.rb
specinfra-2.82.23 lib/specinfra/command/base/process.rb
specinfra-2.82.22 lib/specinfra/command/base/process.rb
specinfra-2.82.21 lib/specinfra/command/base/process.rb
specinfra-2.82.20 lib/specinfra/command/base/process.rb
specinfra-2.82.19 lib/specinfra/command/base/process.rb
specinfra-2.82.18 lib/specinfra/command/base/process.rb
specinfra-2.82.17 lib/specinfra/command/base/process.rb
specinfra-2.82.16 lib/specinfra/command/base/process.rb
specinfra-2.82.15 lib/specinfra/command/base/process.rb
specinfra-2.82.14 lib/specinfra/command/base/process.rb
specinfra-2.82.13 lib/specinfra/command/base/process.rb
specinfra-2.82.12 lib/specinfra/command/base/process.rb
specinfra-2.82.11 lib/specinfra/command/base/process.rb
specinfra-2.82.10 lib/specinfra/command/base/process.rb
specinfra-2.82.9 lib/specinfra/command/base/process.rb
specinfra-2.82.8 lib/specinfra/command/base/process.rb
specinfra-2.82.7 lib/specinfra/command/base/process.rb
specinfra-2.82.6 lib/specinfra/command/base/process.rb