In Ruby 1.9.x, what might be a simple way to either not allow my Ruby script to run again, or wait for the previous instance to finish?**
I'm hoping to avoid messy file-locking or process table checking.
Is there something like a global mutex or semaphore already in the core? I studied the native Mutex but that only seems to apply to threads within one Ruby process, not across different processes.
** Later on I might add timeout functionality, or limit to N instances, or look to be using more than one global lock (one per system-wide resource that should only have max one instance).