mumukit 2.29.0 → 2.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mumukit.rb +1 -0
- data/lib/mumukit/error_pattern.rb +31 -0
- data/lib/mumukit/templates.rb +1 -0
- data/lib/mumukit/templates/file_hook.rb +4 -0
- data/lib/mumukit/templates/with_error_patterns.rb +12 -0
- data/lib/mumukit/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df2ef64cda006497e14e204c2471de45f79292d0c3225981d2129add8e572d75
|
4
|
+
data.tar.gz: 1a2972dfa692d18058e6aabe3b4970f85a4f84a5cdfd104b47f21cc38a106c98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8602bff1f4bb73dfed9ea113622c06ac19fc998be8ba2e23f21190f0bbe37a237eab855b81c687b9391592e3ec895e2788f392302cb7e2065be792a84bc7d1d5
|
7
|
+
data.tar.gz: cc2f4163866f0d736500af00b5165fbdec5e871a4dcc9c0b5de6fbbf8abc66d2749ef1b1d4090618b7ad6646aab402bdd8559c3fffd20f7d11b521299928bac2
|
data/lib/mumukit.rb
CHANGED
@@ -63,6 +63,7 @@ require_relative 'mumukit/with_command_line'
|
|
63
63
|
require_relative 'mumukit/hook'
|
64
64
|
require_relative 'mumukit/runtime'
|
65
65
|
require_relative 'mumukit/isolated_environment'
|
66
|
+
require_relative 'mumukit/error_pattern'
|
66
67
|
require_relative 'mumukit/templates'
|
67
68
|
require_relative 'mumukit/request_validation_error'
|
68
69
|
require_relative 'mumukit/compilation_error'
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Mumukit
|
2
|
+
class ErrorPattern
|
3
|
+
def initialize(regexp)
|
4
|
+
@regexp = regexp
|
5
|
+
end
|
6
|
+
|
7
|
+
def matches?(result)
|
8
|
+
@regexp.matches? result
|
9
|
+
end
|
10
|
+
|
11
|
+
def sanitize(result)
|
12
|
+
result.gsub(@regexp, '').strip
|
13
|
+
end
|
14
|
+
|
15
|
+
def transform(result, status)
|
16
|
+
[sanitize(result), status]
|
17
|
+
end
|
18
|
+
|
19
|
+
class Errored < ErrorPattern
|
20
|
+
def transform(result, _status)
|
21
|
+
super(result, :errored)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class Failed < ErrorPattern
|
26
|
+
def transform(result, _status)
|
27
|
+
super(result, :failed)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/mumukit/templates.rb
CHANGED
@@ -15,6 +15,7 @@ require_relative './templates/with_code_smells'
|
|
15
15
|
require_relative './templates/with_cookie'
|
16
16
|
|
17
17
|
require_relative './templates/file_hook'
|
18
|
+
require_relative './templates/with_error_patterns'
|
18
19
|
require_relative './templates/multi_file_hook'
|
19
20
|
require_relative './templates/try_hook'
|
20
21
|
require_relative './templates/expectations_hook'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Mumukit::Templates
|
2
|
+
module WithErrorPatterns
|
3
|
+
def post_process_file(_file, result, status)
|
4
|
+
error_patterns.each { |it| return it.transform(result, status) if it.matches? result } if status.failed?
|
5
|
+
super
|
6
|
+
end
|
7
|
+
|
8
|
+
def error_patterns
|
9
|
+
[]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/mumukit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.30.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: 2019-
|
11
|
+
date: 2019-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -279,6 +279,7 @@ files:
|
|
279
279
|
- lib/mumukit/defaults/default_validation_hook.rb
|
280
280
|
- lib/mumukit/defaults/default_version_hook.rb
|
281
281
|
- lib/mumukit/env.rb
|
282
|
+
- lib/mumukit/error_pattern.rb
|
282
283
|
- lib/mumukit/explainer.rb
|
283
284
|
- lib/mumukit/hook.rb
|
284
285
|
- lib/mumukit/isolated_environment.rb
|
@@ -311,6 +312,7 @@ files:
|
|
311
312
|
- lib/mumukit/templates/with_code_smells.rb
|
312
313
|
- lib/mumukit/templates/with_cookie.rb
|
313
314
|
- lib/mumukit/templates/with_embedded_environment.rb
|
315
|
+
- lib/mumukit/templates/with_error_patterns.rb
|
314
316
|
- lib/mumukit/templates/with_isolated_environment.rb
|
315
317
|
- lib/mumukit/templates/with_line_number_offset.rb
|
316
318
|
- lib/mumukit/templates/with_mashup_file_content.rb
|