lib/judge_system.rb in judge_system-1.5.0 vs lib/judge_system.rb in judge_system-1.5.1
- old
+ new
@@ -3,10 +3,11 @@
require "net/http"
require "uri"
require "json"
require 'timeout'
require 'pathname'
+
module JudgeSystem
class WandBox
def self.compile compiler: "", code: "", stdin: ""
body = {
@@ -26,16 +27,15 @@
def self.run lang, code, input, time
path = File.expand_path('../', __FILE__ )
sys = File.open("#{path}/compile_systems/#{lang}_system.rb", "r").read
data = nil
- spliter = "\n<$><*><$>\n"
- input = ZlibInput.zlib(input)
- stdin = code + spliter + input + spliter + ("%f" % time)
+ spliter = "<$><*><$>\n"
+ stdin = ZlibInput.zlib(code + spliter + input + spliter + ("%f" % time))
begin
data = compile( compiler: "ruby-head", code: sys, stdin: stdin )
rescue
- return "RE"
+ return 'RE'
end
error = data["program_error"]
result = data["program_output"]
if error == "Killed\n"
return 'TLE'