judge_system 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/judge_system/version.rb +1 -1
- data/lib/judge_system.rb +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f7088fd2eef9535682b723698a1ea2259e732ce
|
4
|
+
data.tar.gz: 7bbbbc92474be94fc9349b656879b32968e77719
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0af5cf270c9203a7f1b94de22fce005553f452f481df1163cfdde6b165078264cbf1b098ad5e743c5e8b2d208b343af32f619b271c4b5c563f02f8758dab2c9
|
7
|
+
data.tar.gz: b54ba0085c5de4861196ad0c76b0d6d9dfd933cbcdfc5b348e2d53b640ed749f607b3696732f6b390efc3584989294d64e9b4c1ccc8058b7fe3c27cb9dcd876e
|
data/lib/judge_system/version.rb
CHANGED
data/lib/judge_system.rb
CHANGED
@@ -3,6 +3,7 @@ require "net/http"
|
|
3
3
|
require "uri"
|
4
4
|
require "json"
|
5
5
|
require 'timeout'
|
6
|
+
require 'pathname'
|
6
7
|
|
7
8
|
module JudgeSystem
|
8
9
|
module Wandbox
|
@@ -29,7 +30,7 @@ module JudgeSystem
|
|
29
30
|
response = http.request(request)
|
30
31
|
JSON.parse(response.body)
|
31
32
|
end
|
32
|
-
|
33
|
+
|
33
34
|
end
|
34
35
|
module_function :compile
|
35
36
|
end
|
@@ -37,8 +38,8 @@ module JudgeSystem
|
|
37
38
|
|
38
39
|
module Wandbox
|
39
40
|
def run lang, code, input, time
|
40
|
-
path =
|
41
|
-
sys = File.open("#{path}/
|
41
|
+
path = File.expand_path('../', __FILE__ )
|
42
|
+
sys = File.open("#{path}/compile_systems/#{lang}_system.cpp", "r").read
|
42
43
|
data = nil
|
43
44
|
stdin = code + "\n<$><*><$><*><$><*><$><*><$><*><$><*><$>\n" + input
|
44
45
|
begin
|
@@ -58,8 +59,8 @@ module JudgeSystem
|
|
58
59
|
module_function :run
|
59
60
|
end
|
60
61
|
|
61
|
-
def judge_result lang, code, answer,
|
62
|
-
output = Wandbox.run lang, code,
|
62
|
+
def judge_result lang: "", code: "" , answer: "", stdin: "", time: 100
|
63
|
+
output = Wandbox.run lang, code, stdin, time
|
63
64
|
if output == 'TLE'
|
64
65
|
return 'TLE'
|
65
66
|
elsif output == 'RE'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: judge_system
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshifumi Kiyono
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|