mumuki-xgobstones-runner 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/expectations_hook.rb +6 -23
- metadata +5 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 324a5da17fdeb860ce32d027e217e2d61da836bc
|
4
|
+
data.tar.gz: b3ae4dbec721d9e361f00a91373f40302adc3a58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc57ea97ee85e8a069cad1f57556c5e9635b508a8d05b0c0d0bd92190ee92f12bf8e1542848f1e72361aa59227af01193b1b5b23cdb24c928d43fbf88cfcea23
|
7
|
+
data.tar.gz: 0c3b44a93be33acb90b94188537b5e739517aba4709a10bf87391436acf9a224d3d8c8960821c3aadd13cc7d416e22338d1832cf0f85a4bd96c5edb2227f43d5
|
data/lib/expectations_hook.rb
CHANGED
@@ -8,11 +8,9 @@ module EvalExpectationsOnAST
|
|
8
8
|
def eval_in_gobstones(binding, ast)
|
9
9
|
pattern_generator = expectations[type]
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
true
|
15
|
-
end
|
11
|
+
result = pattern_generator ? !!(ast =~ pattern_generator[binding]) : true
|
12
|
+
|
13
|
+
negated ? !result : result
|
16
14
|
end
|
17
15
|
|
18
16
|
def use(regexp)
|
@@ -30,10 +28,6 @@ module EvalExpectationsOnAST
|
|
30
28
|
def check_repeat_of(target)
|
31
29
|
use(/AST\(repeat\s*#{target}/)
|
32
30
|
end
|
33
|
-
end
|
34
|
-
|
35
|
-
class Mumukit::Inspection::PlainInspection
|
36
|
-
include EvalExpectationsOnAST
|
37
31
|
|
38
32
|
def expectations
|
39
33
|
{
|
@@ -41,16 +35,7 @@ class Mumukit::Inspection::PlainInspection
|
|
41
35
|
'HasForeach' => use(/AST\(foreach/),
|
42
36
|
'HasRepeat' => check_repeat_of('.+'),
|
43
37
|
'HasVariable' => use(/AST\(assignVarName/),
|
44
|
-
'HasWhile' => use(/AST\(while/)
|
45
|
-
}
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
class Mumukit::Inspection::TargetedInspection
|
50
|
-
include EvalExpectationsOnAST
|
51
|
-
|
52
|
-
def expectations
|
53
|
-
{
|
38
|
+
'HasWhile' => use(/AST\(while/),
|
54
39
|
'HasArity' => lambda { |binding| /#{subject_for(binding).ast_regexp}\s*AST\((\s*\w+){#{target}}\)/ },
|
55
40
|
'HasRepeatOf' => check_repeat_of("AST\\(literal\\s*#{target}\\)"),
|
56
41
|
'HasUsage' => use(/AST\((proc|func)Call\s*#{target}$/)
|
@@ -58,10 +43,8 @@ class Mumukit::Inspection::TargetedInspection
|
|
58
43
|
end
|
59
44
|
end
|
60
45
|
|
61
|
-
class Mumukit::Inspection
|
62
|
-
|
63
|
-
!@inspection.eval_in_gobstones(binding, ast)
|
64
|
-
end
|
46
|
+
class Mumukit::Inspection
|
47
|
+
include EvalExpectationsOnAST
|
65
48
|
end
|
66
49
|
|
67
50
|
class GobstonesExpectationsHook < Mumukit::Defaults::ExpectationsHook
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-xgobstones-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.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: 2017-
|
11
|
+
date: 2017-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit
|
@@ -16,28 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.10'
|
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.
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: mumukit-inspection
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0.1'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0.1'
|
26
|
+
version: '2.10'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: ruby-stones
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
164
|
version: '0'
|
179
165
|
requirements: []
|
180
166
|
rubyforge_project:
|
181
|
-
rubygems_version: 2.5
|
167
|
+
rubygems_version: 2.4.5
|
182
168
|
signing_key:
|
183
169
|
specification_version: 4
|
184
170
|
summary: XGobstones Runner for Mumuki
|