Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/godot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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