Sha256: 332c05b6a7a3a49e610f8064eaac97fb1a266a08287010d9667125e05769eadb

Contents?: true

Size: 350 Bytes

Versions: 2

Compression:

Stored size: 350 Bytes

Contents

module DatabaseStalker::Util

  module_function

  def runned_tail_pids
    pids = ''
    IO.popen("ps x | grep 'tail -f -n 0' | grep -v grep | awk '{print $1}'") do |io|
      while true
        buffer = io.gets
        break if buffer.nil?
        pids += buffer
      end
    end
    pids.split("\n").map do |pid|
      pid.to_i
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
database_stalker-0.1.4 lib/database_stalker/util.rb
database_stalker-0.1.3 lib/database_stalker/util.rb