mumuki-gobstones-runner 1.2.0 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c12c74934309e4653afed1d6402e2d8f9474da3d3fd791d7c5ab2f6604cb3c58
4
- data.tar.gz: 5967cf219b0575ff14bbc6bbcdfa41878fca2f02b6bfadcabb3cce3cb92adc17
3
+ metadata.gz: d1d964e4c022f3264576ae114f974368eb32edf3bbc605b52d0d5cccf17c77db
4
+ data.tar.gz: 71c8e90771bdec934232417488137d01fb4edaf6db64591075bc02713e0d2e1b
5
5
  SHA512:
6
- metadata.gz: f49274e5da567a2a1a904b7f6cdfcf1797df55e9f94437cf598d97238f4b293455ea954365591c40d769edcf0aaefae3cfb98fecabc19793efbc2cee2381bb8e
7
- data.tar.gz: f0bbcfb9c8188fc1849d59826e3e4ddf9819f42c6129438730cdfc1aaa205d9a5b147914cd81059fecddb392a6a73ffbe23e29ef4b39a19082ed45e34bde2e54
6
+ metadata.gz: f718c575eec8fca0f5eda49ddd8ba184e3474cf1c67d5776042d274cc2f6a000f36b0cfd345be3f7e60f703929757d7a5e9cd2ff46efd21867319b84acb0ef47
7
+ data.tar.gz: 67f6ea77587e96f9a7526cabf5309193bd6bf0864b5cbc2f3e271ce8dfc9ac4fc87c1731f047c99f2fc20321a5d09ca32880caf2425592f5608ade2cccc35deb
data/lib/locales/en.yml CHANGED
@@ -14,3 +14,4 @@ en:
14
14
  expected_board: 'Expected final board'
15
15
  final_board: 'Final board'
16
16
  initial_board: 'Initial board'
17
+ no_program_found: 'No program definition was found'
data/lib/locales/es.yml CHANGED
@@ -14,3 +14,4 @@ es:
14
14
  expected_board: 'Tablero final esperado'
15
15
  final_board: 'Tablero final'
16
16
  initial_board: 'Tablero inicial'
17
+ no_program_found: 'No se encontró ninguna definición de programa'
@@ -5,6 +5,7 @@ module Gobstones
5
5
  execution[:status] = execution[:status].to_sym
6
6
 
7
7
  convert_compilation_to_runtime_errors! execution if compilation_error?(execution)
8
+ convert_no_program_error! execution if no_program?(execution)
8
9
 
9
10
  raise Mumukit::Metatest::Errored, error_message(execution) unless success?(execution)
10
11
  execution
@@ -20,8 +21,12 @@ module Gobstones
20
21
  execution[:status] == :compilation_error
21
22
  end
22
23
 
24
+ def no_program?(execution)
25
+ execution[:status] == :no_program_found
26
+ end
27
+
23
28
  def error_message(execution)
24
- return format execution.except(:result).to_json if execution[:status] != :compilation_error
29
+ return format execution.except(:result).to_json unless compilation_error?(execution)
25
30
 
26
31
  error = execution[:result][:finalBoardError]
27
32
  format Gobstones.build_error(error)
@@ -33,6 +38,22 @@ module Gobstones
33
38
  end
34
39
  end
35
40
 
41
+ def convert_no_program_error!(execution)
42
+ execution[:status] = :compilation_error
43
+ execution[:result][:finalBoardError] = {
44
+ on: {
45
+ range: {
46
+ start: {
47
+ row: 0,
48
+ column: 0
49
+ }
50
+ }
51
+ },
52
+ reason: { code: 'no-program-found' },
53
+ message: I18n.t('no_program_found')
54
+ }
55
+ end
56
+
36
57
  def format(error)
37
58
  "<pre>#{error}</pre>"
38
59
  end
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: 1.2.0
4
+ version: 1.3.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: 2018-01-30 00:00:00.000000000 Z
11
+ date: 2018-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit