Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

a little more robust check for autotest/textmate/etc

  • Loading branch information...
commit c02dff8c1bd0d87f250a333410495aa7d0651983 1 parent ded99dc
@timocratic authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 init.rb
View
15 init.rb
@@ -1,8 +1,9 @@
if ENV['RAILS_ENV'] == 'test' && !%w{false none}.include?(ENV['BENCHMARK'])
- while (pid ||= $$).to_i > 0
- pid, *process = `ps -p #{pid} -o ppid -o args`.strip.split("\n").last.split
- @autotest ||= process.join =~ /autotest|textmate|watch/i
- end
-
- require File.dirname(__FILE__) + "/lib/test_benchmark" unless @autotest
-end
+ processes = "ruby"
+ begin
+ pgid = `ps -p #{$$} -o pgid`.split("\n").last
+ processes = `ps -o command -g #{pgid}`
+ rescue StandardError;
+ end
+ require File.dirname(__FILE__) + "/lib/test_benchmark" unless processes =~ /autotest|textmate|watch/i
+end
Please sign in to comment.
Something went wrong with that request. Please try again.