judge0 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be6cceb98b75c3c157176a555aeda2826744f420b0afb7542874ed62b19b1ee8
4
- data.tar.gz: 4601235293d68af691cd420ce9b572f2dbe28bc965b099fef32c2491276ab743
3
+ metadata.gz: 3a8486852c12336f3ec463280981363f553ca8a41c82849c28904881f7f86f7d
4
+ data.tar.gz: 85e1f2015627fd56fce78da6c35cc58df87a6d409125cc262165b416e71746f8
5
5
  SHA512:
6
- metadata.gz: 4b806ca2d4ad2adab6250a7c1e8a70fab3f5197100f98ceb2fc1a08713fa02c619981c0fbe85a7b3b94e8cf4b185ee542c6f87b7a2c66f777078ef64ac19c6c5
7
- data.tar.gz: 4db48c17260a6a6b1ea60537e626f194eced29d85bf3cba25051d8e8975e27b623d1c1cbbfa46868871cdf56a77ff122dc03bb4923cfbf3bc00e3a4f8592872d
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'judge0'
3
- s.version = '0.0.8'
3
+ s.version = '0.0.9'
4
4
  s.date = '2020-01-20'
5
5
  s.summary = 'ruby interface for judge0 api.'
6
6
  s.description = 'ruby interface for judge0 api.'
@@ -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
@@ -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 :token, :stdout, :time, :memory, :stderr, :compile_out,
11
+ attr_reader :stdout, :time, :memory, :stderr, :compile_out,
12
12
  :status_id, :status_description
13
13
 
14
14
  def initialize(options = {})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judge0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Breno Nunes