mumuki-gobstones-runner 2.1.3 → 2.2.0
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/expectations_hook.rb +15 -11
- data/lib/precompile_hook.rb +2 -2
- data/lib/test_hook.rb +4 -4
- data/lib/version_hook.rb +1 -1
- 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: 91e8c6260caa533e79054eb0523b7a50ef314c39cbe095aa522985e7e76f8607
|
|
4
|
+
data.tar.gz: f9b0337db874c710c5339f0454ac98c181961d8f3aa8be40a49b5c7a362235d6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8a8fcda16da5e7e2325bd5dec995855bcdc1a8096d2cce7124f9e2f6641ea358c8fd0899e0d20dbdf4a6fdb103e21e64f3a74a2b3007d2e895ae273f89a647fa
|
|
7
|
+
data.tar.gz: f63dca544118647d5fb28a12bd5e4af9a89a335ab71b2984b6132409ce3b26b7254a92b0ebde10a4e44527b6ac7ebf2763309a67b7866ccc7eab34f3e73a80c7
|
data/lib/expectations_hook.rb
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
class GobstonesExpectationsHook < Mumukit::Templates::MulangExpectationsHook
|
|
2
2
|
include_smells true
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
end
|
|
7
|
-
|
|
4
|
+
# no need to implement `language` and `compile_content`
|
|
5
|
+
# since we are completly overriding `mulang_code`
|
|
8
6
|
def mulang_code(request)
|
|
9
|
-
|
|
10
|
-
Mulang::Code.new(mulang_language, extract_ast(output))
|
|
7
|
+
Mulang::Code.external extract_ast(request)
|
|
11
8
|
end
|
|
12
9
|
|
|
13
10
|
def compile_expectations(request)
|
|
14
11
|
super(request).tap do |expectations|
|
|
15
|
-
request.
|
|
12
|
+
request.precompiled_batch.options[:subject].try do |subject|
|
|
16
13
|
expectations[:ast] << { binding: '*', inspection: "Declares:=#{subject}" }
|
|
17
14
|
end
|
|
18
15
|
end
|
|
@@ -24,12 +21,19 @@ class GobstonesExpectationsHook < Mumukit::Templates::MulangExpectationsHook
|
|
|
24
21
|
|
|
25
22
|
private
|
|
26
23
|
|
|
27
|
-
def extract_ast(
|
|
24
|
+
def extract_ast(request)
|
|
25
|
+
precompiled_output, _ = request.precompiled_result
|
|
26
|
+
|
|
28
27
|
if precompiled_output.is_a?(String)
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
# gobstones cli miserably failed on parsing the submission or the extra code
|
|
29
|
+
logger.warn("Unprocessable GobstonesCLI output:\n\n#{precompiled_output}")
|
|
30
|
+
{tag: :None}
|
|
31
|
+
elsif (ast = precompiled_output.first.dig(:result, :mulangAst)).blank?
|
|
32
|
+
# gobstones cli could not produce a valid ast
|
|
33
|
+
logger.warn("GobstonesCLI produced an empty AST:\n\n#{precompiled_output}")
|
|
34
|
+
{tag: :None}
|
|
31
35
|
else
|
|
32
|
-
|
|
36
|
+
ast
|
|
33
37
|
end
|
|
34
38
|
end
|
|
35
39
|
end
|
data/lib/precompile_hook.rb
CHANGED
|
@@ -31,8 +31,8 @@ class GobstonesPrecompileHook < Mumukit::Templates::FileHook
|
|
|
31
31
|
@locale = request[:locale]
|
|
32
32
|
file = super request
|
|
33
33
|
|
|
34
|
-
struct request.to_h.merge
|
|
35
|
-
|
|
34
|
+
struct request.to_h.merge precompiled_batch: @batch,
|
|
35
|
+
precompiled_result: run!(file)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def add_missing_headers!(request)
|
data/lib/test_hook.rb
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
class GobstonesTestHook < Mumukit::Defaults::TestHook
|
|
2
2
|
def run!(request)
|
|
3
|
-
output, status = request.
|
|
3
|
+
output, status = request.precompiled_result
|
|
4
4
|
|
|
5
|
-
if request.
|
|
5
|
+
if request.precompiled_batch.options[:interactive]
|
|
6
6
|
['', :passed]
|
|
7
7
|
elsif status == :passed
|
|
8
|
-
request.
|
|
8
|
+
request.precompiled_batch.run_tests! output
|
|
9
9
|
else
|
|
10
|
-
request.
|
|
10
|
+
request.precompiled_result
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
end
|
data/lib/version_hook.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mumuki-gobstones-runner
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rodrigo Alfonso
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-04-
|
|
11
|
+
date: 2019-04-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mumukit
|