From 7f11ec06d33bb916b276eb28a6fab2f6ae9000e6 Mon Sep 17 00:00:00 2001 From: Ken Mayer Date: Sat, 23 Mar 2013 10:37:21 -0700 Subject: [PATCH] Wrap curl in method Add a GODOT_DEBUG to the curl method so we can see what the server is returning. --- lib/godot.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/godot.rb b/lib/godot.rb index a75feda..2c82ca3 100644 --- a/lib/godot.rb +++ b/lib/godot.rb @@ -56,7 +56,7 @@ def wait def match!(pattern, path = "", options = "-ks") Timeout.timeout(timeout) do - sleep interval until `curl #{options} http://#{host}:#{port}/#{path}` =~ pattern + sleep interval until curl(host, port, path, options) =~ pattern end end @@ -66,4 +66,10 @@ def match(pattern, path = "", options = "-ks") rescue Timeout::Error false end + + def curl(host, port, path, options) + `curl #{options} http://#{host}:#{port}/#{path}`.tap do |result| + $stderr.puts "\n>>>>>\n" + result + "\n<<<<<\n\n" if ENV['GODOT_DEBUG'] + end + end end