judge0 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/judge0.gemspec +1 -1
- data/lib/judge0.rb +8 -0
- data/lib/submission.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a8486852c12336f3ec463280981363f553ca8a41c82849c28904881f7f86f7d
|
4
|
+
data.tar.gz: 85e1f2015627fd56fce78da6c35cc58df87a6d409125cc262165b416e71746f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b54bf142a8bbf902b7593d39d77ed8732ca5464b9b499a8367a5c44d95cf61c42a8165c48c53b60ece9bbe6a79c69a02b4e6560dc9a7d5d8380ff2ebc45d3d58
|
7
|
+
data.tar.gz: 867311cbcd6469f9b54bc1b4911158b3e74a39a8adfbc1a239dc21728f86a9e8bdaf04403b4ede77b71da1f3bbb0ed986071fa99155cad3b72e3ed987e502ad7
|
data/README.md
CHANGED
@@ -58,6 +58,22 @@ puts sub.output
|
|
58
58
|
|
59
59
|
```
|
60
60
|
|
61
|
+
##### same thing but without creating a Judge0::submission object
|
62
|
+
|
63
|
+
this is useful when you are trying to wait the response on a rails job but cant pass a submission as a params without writing a serializer, maybe in future i will make a job serializer and configure it out of the box
|
64
|
+
|
65
|
+
```ruby
|
66
|
+
params = {
|
67
|
+
"source_code": "sleep 2; p 'Hello word!'",
|
68
|
+
"language_id": 72
|
69
|
+
}
|
70
|
+
|
71
|
+
token = Judge0.get_token(params)
|
72
|
+
|
73
|
+
Judge0.wait_response(token)
|
74
|
+
|
75
|
+
```
|
76
|
+
|
61
77
|
### tests battery execution
|
62
78
|
|
63
79
|
```ruby
|
data/judge0.gemspec
CHANGED
data/lib/judge0.rb
CHANGED
@@ -6,6 +6,14 @@ require 'submission.rb'
|
|
6
6
|
module Judge0
|
7
7
|
@@base_url = 'http://roupi.xyz:3000/'
|
8
8
|
|
9
|
+
def self.get_token(params)
|
10
|
+
Judge0::Submission.new(params).get_token
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.wait_response(token)
|
14
|
+
Judge0::Submission.new(token: token).wait_response
|
15
|
+
end
|
16
|
+
|
9
17
|
def self.base_url=(url)
|
10
18
|
@@base_url = url
|
11
19
|
end
|
data/lib/submission.rb
CHANGED
@@ -6,9 +6,9 @@ module Judge0
|
|
6
6
|
:max_processes_and_or_threads,
|
7
7
|
:enable_per_process_and_thread_time_limit,
|
8
8
|
:enable_per_process_and_thread_memory_limit,
|
9
|
-
:max_file_size
|
9
|
+
:max_file_size, :token
|
10
10
|
|
11
|
-
attr_reader :
|
11
|
+
attr_reader :stdout, :time, :memory, :stderr, :compile_out,
|
12
12
|
:status_id, :status_description
|
13
13
|
|
14
14
|
def initialize(options = {})
|