class Sv::Status

Attributes

socket_path[R]

Public Class Methods

new(socket_path) click to toggle source
# File lib/sv/status.rb, line 8
def initialize(socket_path)
  @socket_path = socket_path
end

Public Instance Methods

running?() click to toggle source
# File lib/sv/status.rb, line 12
def running?
  socket_path = File.realdirpath @socket_path
  s = UNIXSocket.new(socket_path) 
  s.close
  return true
rescue Errno::ECONNREFUSED, Errno::ENOENT
  return false
end
stopped?() click to toggle source
# File lib/sv/status.rb, line 21
def stopped?
  not running?
end
wait_until_stopped() click to toggle source
# File lib/sv/status.rb, line 25
def wait_until_stopped
  loop do
    break if not running?
    sleep 0.1
  end
end