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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3294a46aaa12f33ed104aceb00d1a36be89735d9
4
- data.tar.gz: 0fb22e4a345143faa2962a0d8a52f4c94a048f5e
3
+ metadata.gz: 5f7088fd2eef9535682b723698a1ea2259e732ce
4
+ data.tar.gz: 7bbbbc92474be94fc9349b656879b32968e77719
5
5
  SHA512:
6
- metadata.gz: 9dd06c5921d69176d2de37144fa789b1b73089646928e1249cda0bb9febfcc5308b80486715c18a0b9b1e3ae235e1c9e14f7f8b3c93ce7ba9481de195898ddd8
7
- data.tar.gz: e42df5751978e866a7fcc3b6d2fa015b2ff6143fbe2354b73df65e5de3f6e70883935cd50920723f627193798bf8cade73d47041c82d63328719d59c692f7dd2
6
+ metadata.gz: d0af5cf270c9203a7f1b94de22fce005553f452f481df1163cfdde6b165078264cbf1b098ad5e743c5e8b2d208b343af32f619b271c4b5c563f02f8758dab2c9
7
+ data.tar.gz: b54ba0085c5de4861196ad0c76b0d6d9dfd933cbcdfc5b348e2d53b640ed749f607b3696732f6b390efc3584989294d64e9b4c1ccc8058b7fe3c27cb9dcd876e
@@ -1,3 +1,3 @@
1
1
  module JudgeSystem
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
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 = Gem::Specification.find_by_path('judge_system').full_gem_path
41
- sys = File.open("#{path}/lib/compile_systems/#{lang}_system.cpp", "r").read
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, input, time
62
- output = Wandbox.run lang, code, input, time
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.0.0
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-21 00:00:00.000000000 Z
11
+ date: 2017-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler