Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

a little more robust check for autotest/textmate/etc

  • Loading branch information...
commit c02dff8c1bd0d87f250a333410495aa7d0651983 1 parent ded99dc
Tim Connor authored April 14, 2010

Showing 1 changed file with 8 additions and 7 deletions. Show diff stats Hide diff stats

  1. 15  init.rb
15  init.rb
... ...
@@ -1,8 +1,9 @@
1 1
 if ENV['RAILS_ENV'] == 'test' && !%w{false none}.include?(ENV['BENCHMARK'])
2  
-  while (pid ||= $$).to_i > 0
3  
-    pid, *process = `ps -p #{pid} -o ppid -o args`.strip.split("\n").last.split
4  
-    @autotest ||= process.join =~ /autotest|textmate|watch/i 
5  
-  end 
6  
-
7  
-  require File.dirname(__FILE__) + "/lib/test_benchmark" unless @autotest
8  
-end
  2
+  processes = "ruby"
  3
+  begin
  4
+    pgid = `ps -p #{$$} -o pgid`.split("\n").last
  5
+    processes = `ps -o command -g #{pgid}`
  6
+  rescue StandardError;
  7
+  end
  8
+  require File.dirname(__FILE__) + "/lib/test_benchmark" unless processes =~ /autotest|textmate|watch/i
  9
+end

0 notes on commit c02dff8

Please sign in to comment.
Something went wrong with that request. Please try again.