From bdeef4696ffacfe04e298ba83fc4072a18924e8d Mon Sep 17 00:00:00 2001
From: Kuba Brecka <kuba.brecka@gmail.com>
Date: Fri, 8 Mar 2013 16:46:23 +0100
Subject: [PATCH] messagebus diagnostics process path on Mac OS

---
 vendor/gems/message_bus/lib/message_bus/diagnostics.rb | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/vendor/gems/message_bus/lib/message_bus/diagnostics.rb b/vendor/gems/message_bus/lib/message_bus/diagnostics.rb
index ed1a954df..871755afb 100644
--- a/vendor/gems/message_bus/lib/message_bus/diagnostics.rb
+++ b/vendor/gems/message_bus/lib/message_bus/diagnostics.rb
@@ -1,8 +1,13 @@
 class MessageBus::Diagnostics
   def self.full_process_path
     begin
-      info = `ps -eo "%p|$|%a" | grep '^\\s*#{Process.pid}'`
-      info.strip.split('|$|')[1]
+      system = `uname`.strip
+      if system == "Darwin"
+        `ps -o "comm=" -p #{Process.pid}`
+      else
+        info = `ps -eo "%p|$|%a" | grep '^\\s*#{Process.pid}'`
+        info.strip.split('|$|')[1]
+      end
     rescue
       # skip it ... not linux or something weird
     end