T
The One
Hi,
how would idiomatic Ruby look like when it comes to status checks of
processes? Here's a short method which checks if a PostgreSQL cluster is
up:
def running?
output = `/etc/init.d/postgresql-8.3 status`.split
output[3] == "up" ? true : false
end
What's the preferred way?
how would idiomatic Ruby look like when it comes to status checks of
processes? Here's a short method which checks if a PostgreSQL cluster is
up:
def running?
output = `/etc/init.d/postgresql-8.3 status`.split
output[3] == "up" ? true : false
end
What's the preferred way?