mumukit 2.35.0 → 2.39.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: c93b40ab8d9ea10cfe1e73457763ef6146c396fbfe6feeab318e0e4938553fff
4
- data.tar.gz: e7b34dad3b8a67f5be0468e720bfae08a985eae4f7b299886919a03a765367e3
3
+ metadata.gz: 5b9858200475db12bcde59a3fa64da16b23378dbc1267e2afca1c022819e53ac
4
+ data.tar.gz: 610db1e398ff3d5cd4fcbd11254ea9efddbb4be58d49a476253ada519cc573a1
5
5
  SHA512:
6
- metadata.gz: 40a8ad3cbe13a399ae7d012819eff925497920cd1233e6b4f16db14aa5f60fe0b6b521c491532c77d36f7b1c5e998b3aa132275006fd55bab3b944c258f429ef
7
- data.tar.gz: 5135710e6ebbb026321d6f36fdcb0139203612d75ec5255805158438ef7008cf469813ae778395c42aa1f16b3ccd8e47366a94f5ec8adcc75b624cff8ef75aa1
6
+ metadata.gz: fc2fdf2ae6b17a495a7e016466046c54127f8acb8ec1628ed2e97dc16756caa8e18dbcc5cad8cd637a6e840597da70ea7da25664ed21a30ae4577d39de7a2e1e
7
+ data.tar.gz: 3e2cb601a96843576d46c5e401ff1999a0a4435be949e1fb66e2f15c94ed108a6c33b64af9e6bfd008ef0514ff6cde1deab888ddbff82d0ebd8d2eea478edbdf
@@ -0,0 +1,17 @@
1
+ es-CL:
2
+ mumukit:
3
+ memory_exceeded: Limite de memoria excedido. ¿Tu programa está alocando demasiada memoria?
4
+ time_exceeded: Limite de tiempo de ejecución de %{limit}s excedido. ¿Tu programa tiene recursión o bucle infinito?
5
+ masked_tempfile_basename: solucion
6
+ interactive:
7
+ check_last_query_equals: "La consulta debería ser '%{expected}' pero fue '%{actual}'"
8
+ check_last_query_fails: "La consulta debería fallar pero pasó"
9
+ check_last_query_matches: "La consulta no cumple con la expresión regular %{regex}"
10
+ check_last_query_outputs: "La consulta debería devolver '%{expected}' pero devolvió '%{actual}'"
11
+ check_last_query_includes: "La consulta debería incluir '%{expected}' pero devolvió '%{actual}'"
12
+ check_last_query_like: "La consulta debería ser como '%{expected}' pero devolvió '%{actual}'"
13
+ check_last_query_passes: "La consulta debería pasar pero falló"
14
+ check_query_fails: "La consulta '%{query}' debería fallar pero pasó"
15
+ check_query_outputs: "La consulta '%{query}' debería devolver '%{expected}' pero devolvió '%{actual}'"
16
+ check_query_passes: "La consulta '%{query}' debería pasar pero falló"
17
+ goal_passed: "El objetivo se cumplió exitosamente"
@@ -1,7 +1,7 @@
1
1
  es:
2
2
  mumukit:
3
3
  memory_exceeded: Limite de memoria excedido. ¿Tu programa está alocando demasiada memoria?
4
- time_exceeded: Limite de tiempo de ejecución de %{limit}s excedido. ¿Tu programa tiene recursión o bucle infinito?
4
+ time_exceeded: Limite de tiempo de ejecución de %{limit}s excedido. ¿Tu programa tiene recursión o bucle infinito?
5
5
  masked_tempfile_basename: solucion
6
6
  interactive:
7
7
  check_last_query_equals: "La consulta debería ser '%{expected}' pero fue '%{actual}'"
@@ -14,4 +14,4 @@ es:
14
14
  check_query_fails: "La consulta '%{query}' debería fallar pero pasó"
15
15
  check_query_outputs: "La consulta '%{query}' debería devolver '%{expected}' pero devolvió '%{actual}'"
16
16
  check_query_passes: "La consulta '%{query}' debería pasar pero falló"
17
- goal_passed: "El objetivo se cumplió exitosamente"
17
+ goal_passed: "El objetivo se cumplió exitosamente"
@@ -1,11 +1,17 @@
1
1
  class Mumukit::Explainer
2
+ include Mumukit::WithContentType
3
+
2
4
  def explain(content, test_results)
5
+ content_type.enumerate(explanations(content, test_results))
6
+ end
7
+
8
+ private
9
+
10
+ def explanations(content, test_results)
3
11
  explain_methods
4
12
  .map { |selector, key| eval_explain(selector, key, content, test_results) }
5
13
  .compact
6
14
  .map { |explain| I18n.t(explain[:key], explain[:binding]) }
7
- .map { |it| "* #{it}" }
8
- .join("\n")
9
15
  end
10
16
 
11
17
  def eval_explain(selector, key, content, test_results)
@@ -64,7 +64,7 @@ module Mumukit::Metatest
64
64
 
65
65
  # Implementors should override this method if they want access to
66
66
  # the error details and produce more complex test results
67
- def build_error_output(builder, input, _example, error)
67
+ def build_error_output(builder, _example, input, error)
68
68
  builder.result = render_error_output input, error.message
69
69
  end
70
70
 
@@ -2,12 +2,12 @@ require 'mulang'
2
2
 
3
3
  module Mumukit
4
4
  class Templates::MulangExpectationsHook < Mumukit::Templates::ExpectationsHook
5
- LOGIC_SMELLS = %w(UsesCut UsesFail UsesUnificationOperator HasRedundantReduction)
6
- FUNCTIONAL_SMELLS = %w(HasRedundantParameter HasRedundantGuards)
7
- OBJECT_ORIENTED_SMELLS = %w(DoesNullTest ReturnsNull)
8
- IMPERATIVE_SMELLS = %w(HasRedundantLocalVariableReturn HasAssignmentReturn)
9
- EXPRESSIVENESS_SMELLS = %w(HasTooShortIdentifiers HasWrongCaseIdentifiers HasMisspelledIdentifiers)
10
- GENERIC_SMELLS = %w(IsLongCode HasCodeDuplication HasRedundantLambda HasRedundantIf DoesTypeTest HasRedundantBooleanComparison HasEmptyIfBranches)
5
+ LOGIC_SMELLS = Mulang::Expectation::LOGIC_SMELLS
6
+ FUNCTIONAL_SMELLS = Mulang::Expectation::FUNCTIONAL_SMELLS
7
+ OBJECT_ORIENTED_SMELLS = Mulang::Expectation::OBJECT_ORIENTED_SMELLS
8
+ IMPERATIVE_SMELLS = Mulang::Expectation::IMPERATIVE_SMELLS
9
+ EXPRESSIVENESS_SMELLS = Mulang::Expectation::EXPRESSIVENESS_SMELLS
10
+ GENERIC_SMELLS = Mulang::Expectation::GENERIC_SMELLS
11
11
 
12
12
  required :language, 'You have to provide a Mulang-compatible language in order to use this hook'
13
13
 
@@ -16,14 +16,19 @@ module Mumukit
16
16
  end
17
17
 
18
18
  def compile_mulang_analysis(request, expectations)
19
- mulang_code(request).analysis(
19
+ mulang_code(request).analysis({
20
20
  expectations: expectations[:ast],
21
21
  customExpectations: expectations[:custom],
22
22
  smellsSet: {
23
23
  tag: 'AllSmells',
24
24
  exclude: (expectations[:exceptions] + default_smell_exceptions)
25
25
  },
26
- domainLanguage: domain_language)
26
+ domainLanguage: domain_language
27
+ }.merge({
28
+ originalLanguage: original_language,
29
+ autocorrectionRules: autocorrection_rules.try { |it| positive_and_negative it }.presence,
30
+ normalizationOptions: normalization_options(request).presence
31
+ }.compact))
27
32
  end
28
33
 
29
34
  def run_mulang_analysis(analysis)
@@ -32,7 +37,6 @@ module Mumukit
32
37
  raise Mumukit::CompilationError, "Can not handle mulang results for analysis #{analysis}"
33
38
  end
34
39
 
35
-
36
40
  def domain_language
37
41
  {
38
42
  caseStyle: "CamelCase",
@@ -41,6 +45,17 @@ module Mumukit
41
45
  }
42
46
  end
43
47
 
48
+ def normalization_options(request)
49
+ request.dig(:settings, :normalization_options) || {}
50
+ end
51
+
52
+ def autocorrection_rules
53
+ {}
54
+ end
55
+
56
+ def original_language
57
+ end
58
+
44
59
  def default_smell_exceptions
45
60
  []
46
61
  end
@@ -76,5 +91,11 @@ module Mumukit
76
91
  include Mumukit::Templates::WithCodeSmells
77
92
  end
78
93
  end
94
+
95
+ private
96
+
97
+ def positive_and_negative(rules)
98
+ rules.flat_map { |k, v| [[k, v], ["Not:#{k}", "Not:#{v}"]] }.to_h
99
+ end
79
100
  end
80
101
  end
@@ -1,3 +1,3 @@
1
1
  module Mumukit
2
- VERSION = '2.35.0'
2
+ VERSION = '2.39.0'
3
3
  end
metadata CHANGED
@@ -1,63 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.35.0
4
+ version: 2.39.0
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: 2020-05-11 00:00:00.000000000 Z
11
+ date: 2021-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '1.7'
20
- - - "<"
17
+ - - "~>"
21
18
  - !ruby/object:Gem::Version
22
- version: '3'
19
+ version: '2.0'
23
20
  type: :development
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: '1.7'
30
- - - "<"
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
- version: '3'
26
+ version: '2.0'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: rake
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: '10.0'
33
+ version: '12.3'
40
34
  type: :development
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
38
  - - "~>"
45
39
  - !ruby/object:Gem::Version
46
- version: '10.0'
40
+ version: '12.3'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: rspec
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '2'
47
+ version: '3.0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
52
  - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: '2'
54
+ version: '3.0'
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: codeclimate-test-reporter
63
57
  requirement: !ruby/object:Gem::Requirement
@@ -176,14 +170,14 @@ dependencies:
176
170
  requirements:
177
171
  - - "~>"
178
172
  - !ruby/object:Gem::Version
179
- version: '0.46'
173
+ version: '0.71'
180
174
  type: :runtime
181
175
  prerelease: false
182
176
  version_requirements: !ruby/object:Gem::Requirement
183
177
  requirements:
184
178
  - - "~>"
185
179
  - !ruby/object:Gem::Version
186
- version: '0.46'
180
+ version: '0.71'
187
181
  - !ruby/object:Gem::Dependency
188
182
  name: sinatra-cross_origin
189
183
  requirement: !ruby/object:Gem::Requirement
@@ -218,28 +212,28 @@ dependencies:
218
212
  requirements:
219
213
  - - "~>"
220
214
  - !ruby/object:Gem::Version
221
- version: '5.1'
215
+ version: '6.0'
222
216
  type: :runtime
223
217
  prerelease: false
224
218
  version_requirements: !ruby/object:Gem::Requirement
225
219
  requirements:
226
220
  - - "~>"
227
221
  - !ruby/object:Gem::Version
228
- version: '5.1'
222
+ version: '6.0'
229
223
  - !ruby/object:Gem::Dependency
230
224
  name: mumukit-inspection
231
225
  requirement: !ruby/object:Gem::Requirement
232
226
  requirements:
233
227
  - - "~>"
234
228
  - !ruby/object:Gem::Version
235
- version: '5.0'
229
+ version: '6.0'
236
230
  type: :runtime
237
231
  prerelease: false
238
232
  version_requirements: !ruby/object:Gem::Requirement
239
233
  requirements:
240
234
  - - "~>"
241
235
  - !ruby/object:Gem::Version
242
- version: '5.0'
236
+ version: '6.0'
243
237
  - !ruby/object:Gem::Dependency
244
238
  name: mumukit-core
245
239
  requirement: !ruby/object:Gem::Requirement
@@ -272,22 +266,16 @@ dependencies:
272
266
  name: mumukit-content-type
273
267
  requirement: !ruby/object:Gem::Requirement
274
268
  requirements:
275
- - - ">="
276
- - !ruby/object:Gem::Version
277
- version: '0.2'
278
- - - "<"
269
+ - - "~>"
279
270
  - !ruby/object:Gem::Version
280
- version: '2'
271
+ version: '1.10'
281
272
  type: :runtime
282
273
  prerelease: false
283
274
  version_requirements: !ruby/object:Gem::Requirement
284
275
  requirements:
285
- - - ">="
286
- - !ruby/object:Gem::Version
287
- version: '0.2'
288
- - - "<"
276
+ - - "~>"
289
277
  - !ruby/object:Gem::Version
290
- version: '2'
278
+ version: '1.10'
291
279
  description: Helpers for building a Mumuki Test Server
292
280
  email:
293
281
  - flbulgarelli@yahoo.com.ar
@@ -297,6 +285,7 @@ extra_rdoc_files: []
297
285
  files:
298
286
  - bin/limit
299
287
  - lib/locales/en.yml
288
+ - lib/locales/es-CL.yml
300
289
  - lib/locales/es.yml
301
290
  - lib/locales/pt.yml
302
291
  - lib/mumukit.rb
@@ -380,8 +369,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
380
369
  - !ruby/object:Gem::Version
381
370
  version: '0'
382
371
  requirements: []
383
- rubyforge_project:
384
- rubygems_version: 2.7.7
372
+ rubygems_version: 3.0.3
385
373
  signing_key:
386
374
  specification_version: 4
387
375
  summary: Mumuki Test Server Development Kit