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.91.0 lib/specinfra/command/base/process.rb
specinfra-2.90.1 lib/specinfra/command/base/process.rb
specinfra-2.90.0 lib/specinfra/command/base/process.rb
specinfra-2.89.0 lib/specinfra/command/base/process.rb
specinfra-2.88.2 lib/specinfra/command/base/process.rb
specinfra-2.88.1 lib/specinfra/command/base/process.rb
specinfra-2.88.0 lib/specinfra/command/base/process.rb
specinfra-2.87.2 lib/specinfra/command/base/process.rb
specinfra-2.87.1 lib/specinfra/command/base/process.rb
specinfra-2.87.0 lib/specinfra/command/base/process.rb
specinfra-2.86.0 lib/specinfra/command/base/process.rb
specinfra-2.85.1 lib/specinfra/command/base/process.rb
specinfra-2.85.0 lib/specinfra/command/base/process.rb
specinfra-2.84.1 lib/specinfra/command/base/process.rb
specinfra-2.84.0 lib/specinfra/command/base/process.rb
specinfra-2.83.4 lib/specinfra/command/base/process.rb
specinfra-2.83.3 lib/specinfra/command/base/process.rb
specinfra-2.83.2 lib/specinfra/command/base/process.rb
specinfra-2.83.1 lib/specinfra/command/base/process.rb
specinfra-2.83.0 lib/specinfra/command/base/process.rb