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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4a1cf971f4ce948e0e251e05f92672ca1c01e2b7f4441b60f57634c8cd89c68
4
- data.tar.gz: 6bf96e4e38f596547ed4258c8447e8f6be826a8afedb75989fef278ea70a1664
3
+ metadata.gz: 89a420abcb59de7ed38a51511b8fb5ec96c3649c89e2ae59f703927204934871
4
+ data.tar.gz: 2d08a9831ed7b49972fcf1d863a9b0ec0284cc200fd104a5c79cf1f006db8e8a
5
5
  SHA512:
6
- metadata.gz: f6340927de462b077cda6f61ea5dfb8b3bdc7ff1419abd8d59f623c33cac2f7c40eba7770a92b5a20c560b2e1e7b98d1343f668f93d9e6441e7c4d63c2b5669d
7
- data.tar.gz: e5858f8ff89f2a13e1a1f65e265f4467a1e4017ed2c42bbbd92986e22436d54c46994c79e684384e1288a44ec3bb3dc492aaf305ab65adad08fc8223ceb5284b
6
+ metadata.gz: b0a1dab1ce1ebfd01db007ee8b0b56bff51b2217679a1018901d396ec05c544edb8cf9a4e508da02cc226590b78e926e61b9e2cb664a1540ce3e9da553818750
7
+ data.tar.gz: 6d85cdf41b0c5fb71395ec128b657f2b5923b9cf50618f8a4e6d034c21c604a68a9e63c4f3c065b80134385042922283ad77e2b4bd5612bedc8351e74bdf88f6
data/lib/base/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  module BasePythonVersionHook
3
- VERSION = '1.8.0'
3
+ VERSION = '1.8.1'
4
4
  end
@@ -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: :query_hook
21
- delegate :command_line, to: :query_hook
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
- #{goal_separator}
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($1, status),
40
- goal: $2,
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.0
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-06 00:00:00.000000000 Z
11
+ date: 2021-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit