mumuki-gobstones-runner 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4fe34fef138bf0859527895cb59379df587c6516185c2ce173a7931bc469b06
4
- data.tar.gz: 28c29381f777e2d135b015b3e4756e110d4fa2e4ee8b8594bcb1c66f9b44810f
3
+ metadata.gz: 3bc2d1290cae35da099fd7e91689d5ae3cf0a7bffd20f1e35b0c5c5c811d5119
4
+ data.tar.gz: 4006b96d27cd8ea4847a867a31328d4cc662f14beec8e224e627e6c913bc060d
5
5
  SHA512:
6
- metadata.gz: 2e1fa96d5610b21dca6b3f80f05919146a7aa7aceb9105886f4979d36866115c62993abeafba162b33652767adb47cfa03c4c251a9eaf077d50277c34b903065
7
- data.tar.gz: ffbe858ca591972a3494d04ab4f81dc208ab92fd86dc6dcf6739ee84cd62021a4e8171e9aa352e1e12cf72ac848092fa30e78f5e3e079ef3d16fc190a554edc7
6
+ metadata.gz: e3f58a1d6d5f5f4d7d717ed70bd910cf75d220a3d32e1843815b957a9d643e45b61de3205bf0de063108d2630e3ac353f06c451536762c1613211ca83718ddf0
7
+ data.tar.gz: af975fc874df88846613a5460b8f8be901065d3415f8cc0164f1d9b06ca4f4c1beba26b4a511ed15191c60257b9266b8ccb535ec1ea9438c5fe75bc9f724e1ae
@@ -6,6 +6,7 @@ class Mumukit::Server::App < Sinatra::Base
6
6
 
7
7
  configure do
8
8
  enable :cross_origin
9
+ set :allow_origin, '*'
9
10
  end
10
11
 
11
12
  def self.get_asset(route, absolute_path, type)
@@ -5,7 +5,7 @@ I18n.load_translations_path File.join(__dir__, 'locales', '*.yml')
5
5
 
6
6
  Mumukit.runner_name = 'gobstones'
7
7
  Mumukit.configure do |config|
8
- config.docker_image = 'mumuki/mumuki-gobstones-worker:1.0'
8
+ config.docker_image = 'mumuki/mumuki-gobstones-worker:1.1'
9
9
  config.content_type = 'html'
10
10
  config.structured = true
11
11
  end
@@ -0,0 +1,17 @@
1
+ pt:
2
+ actual_board: 'Tabuleiro final obtido'
3
+ check_failed_unexpected_boom: 'O programa fez BOOM.'
4
+ check_final_board_failed_different_boards: 'Um tabuleiro diferente foi obtido do que o esperado'
5
+ check_error_failed_expected_boom: 'Esperava-se que o programa fizesse BOOM, mas foi executado normalmente'
6
+ check_error_failed_another_reason: 'Esperava-se que o programa fosse BOOM para <strong>%{expected_code}</strong>, mas falhou por outro motivo'
7
+ check_return_failed_different_values: 'Esperava-se <strong>%{expected_value}</strong> mas foi obtido <strong>%{actual_value}</strong>.'
8
+ check_return_failed_no_return: 'Esperava-se <strong>%{expected_value}</strong> mas nenhum valor foi obtido.'
9
+ code_no_stones: 'sem bolas disponíveis'
10
+ code_out_of_board: 'queda do tabuleiro'
11
+ code_wrong_argument_type: 'problema de tipos nos argumentos'
12
+ code_unassigned_variable: 'variável não atribuída'
13
+ code_wrong_arguments_quantity: 'quantidade errada de argumentos'
14
+ expected_board: 'Tabuleiro final esperado'
15
+ final_board: 'Tabuleiro final'
16
+ initial_board: 'Tabuleiro inicial'
17
+ no_program_found: 'Nenhuma definição de programa foi encontrada'
@@ -9,11 +9,16 @@ class GobstonesPrecompileHook < Mumukit::Templates::FileHook
9
9
  end
10
10
 
11
11
  def command_line(filename)
12
- "gobstones-cli --batch #{filename}"
12
+ "gobstones-cli --batch #{filename} #{locale_argument}"
13
+ end
14
+
15
+ def locale_argument
16
+ "--language #{@locale}" if @locale
13
17
  end
14
18
 
15
19
  def compile(request)
16
20
  add_missing_headers! request
21
+ @locale = request[:locale]
17
22
  file = super request
18
23
 
19
24
  struct request.to_h.merge batch: @batch,
@@ -21,7 +26,7 @@ class GobstonesPrecompileHook < Mumukit::Templates::FileHook
21
26
  end
22
27
 
23
28
  def add_missing_headers!(request)
24
- request.test.gsub! /(.*(initial_board|final_board).*\n)(?!.*GBB\/1\.0.*)/, "\\1 GBB/1.0\\3\n"
29
+ request.test.gsub! /(.*(initial_board|final_board): \|.*\n)(?!.*GBB\/1\.0.*)/, "\\1 GBB/1.0\\3\n"
25
30
  end
26
31
 
27
32
  def compile_file_content(request)
@@ -8,7 +8,9 @@ module Gobstones
8
8
  end
9
9
 
10
10
  def render_success(result)
11
- bind_result boards: prepare_boards([:initial, :final], result),
11
+ boards = [:initial, :final]
12
+ boards.reject!{ |it| it === :initial } unless @options[:show_initial_board]
13
+ bind_result boards: prepare_boards(boards, result),
12
14
  reason: prepare_reason(result[:reason])
13
15
  end
14
16
 
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.4.0
4
+ version: 1.5.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-02-01 00:00:00.000000000 Z
11
+ date: 2018-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.19'
19
+ version: '2.20'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.19'
26
+ version: '2.20'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sinatra-cross_origin
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -156,6 +156,7 @@ files:
156
156
  - lib/gobstones_runner.rb
157
157
  - lib/locales/en.yml
158
158
  - lib/locales/es.yml
159
+ - lib/locales/pt.yml
159
160
  - lib/metadata_hook.rb
160
161
  - lib/multiple_executions_runner.rb
161
162
  - lib/precompile_hook.rb