mumuki-python-runner 1.8.0 → 1.8.1
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 +4 -4
- data/lib/base/version.rb +1 -1
- data/lib/python3/try_hook.rb +15 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89a420abcb59de7ed38a51511b8fb5ec96c3649c89e2ae59f703927204934871
|
4
|
+
data.tar.gz: 2d08a9831ed7b49972fcf1d863a9b0ec0284cc200fd104a5c79cf1f006db8e8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0a1dab1ce1ebfd01db007ee8b0b56bff51b2217679a1018901d396ec05c544edb8cf9a4e508da02cc226590b78e926e61b9e2cb664a1540ce3e9da553818750
|
7
|
+
data.tar.gz: 6d85cdf41b0c5fb71395ec128b657f2b5923b9cf50618f8a4e6d034c21c604a68a9e63c4f3c065b80134385042922283ad77e2b4bd5612bedc8351e74bdf88f6
|
data/lib/base/version.rb
CHANGED
data/lib/python3/try_hook.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
class Python3TryHook < Mumukit::Templates::TryHook
|
2
2
|
isolated true
|
3
|
-
attr_reader :query_hook
|
4
3
|
|
5
4
|
def initialize(config = nil)
|
6
5
|
super config
|
@@ -9,16 +8,20 @@ class Python3TryHook < Mumukit::Templates::TryHook
|
|
9
8
|
|
10
9
|
def compile_file_content(r)
|
11
10
|
<<python
|
12
|
-
#{query_hook.compile_file_header(r)}
|
11
|
+
#{@query_hook.compile_file_header(r)}
|
13
12
|
print("#{query_separator}");
|
14
|
-
#{query_hook.compile_query(r.query, '')}
|
13
|
+
#{@query_hook.compile_query(r.query, '')}
|
15
14
|
print("#{goal_separator}");
|
16
|
-
#{query_hook.compile_query(r.goal.indifferent_get(:query) || 'None', '')}
|
15
|
+
#{@query_hook.compile_query(r.goal.indifferent_get(:query) || 'None', '')}
|
17
16
|
python
|
18
17
|
end
|
19
18
|
|
20
|
-
delegate :tempfile_extension, to:
|
21
|
-
delegate :command_line, to:
|
19
|
+
delegate :tempfile_extension, to: :@query_hook
|
20
|
+
delegate :command_line, to: :@query_hook
|
21
|
+
|
22
|
+
def post_process_file(file, result, status)
|
23
|
+
super file, *@query_hook.post_process_file(file, result, status)
|
24
|
+
end
|
22
25
|
|
23
26
|
def query_separator
|
24
27
|
'!!!MUMUKI-QUERY-START!!!'
|
@@ -29,15 +32,14 @@ python
|
|
29
32
|
end
|
30
33
|
|
31
34
|
def to_structured_results(_file, result, status)
|
32
|
-
/#{query_separator}
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
/m =~ result
|
35
|
+
result_match = result[/#{query_separator}
|
36
|
+
\K.*?(?=(#{goal_separator})|\z)/m]&.rstrip
|
37
|
+
goal_match = result[/#{goal_separator}
|
38
|
+
\K.*\z/m]&.rstrip
|
37
39
|
|
38
40
|
{
|
39
|
-
query: to_query_result(
|
40
|
-
goal:
|
41
|
+
query: to_query_result(result_match, status),
|
42
|
+
goal: goal_match,
|
41
43
|
status: status
|
42
44
|
}
|
43
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-python-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit
|