You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sebastian Bazley <se...@apache.org> on 2016/03/20 01:27:42 UTC

[whimsy.git] [1/1] Commit 7dff5ca: type does not work; add sleep

Commit 7dff5caf2e36b98b665ae27521c5cb9cb9792312:
     type does not work; add sleep


Branch: refs/heads/master
Author: Sebb <se...@apache.org>
Committer: Sebb <se...@apache.org>
Pusher: sebb <se...@apache.org>

------------------------------------------------------------
www/test.cgi                                                 | ++++++++ -
------------------------------------------------------------
9 changes: 8 additions, 1 deletions.
------------------------------------------------------------


diff --git a/www/test.cgi b/www/test.cgi
index 8b5619a..4c36019 100755
--- a/www/test.cgi
+++ b/www/test.cgi
@@ -19,6 +19,13 @@ end
 query = ENV['QUERY_STRING']
 if query and not query.empty? and ENV['SCRIPT_URL'] == '/test.cgi'
     print "\n"
-    system('type','ruby')
+    system('which','-a','ruby')
     system('ruby','-v')
+    wait=query.match(/^sleep=(\d+)$/)[1].to_i rescue 0
+    if wait > 0
+      print "\nWaiting #{wait} seconds ..."
+      STDOUT.flush
+      sleep wait
+      print " done waiting\n"
+    end
 end