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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/expectations_hook.rb +6 -23
  3. metadata +5 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b60824133496b2b3b4b76963a33d6c69f876be3
4
- data.tar.gz: c5e5ab3d1e63939b482e8f58e4ab96f07b720052
3
+ metadata.gz: 324a5da17fdeb860ce32d027e217e2d61da836bc
4
+ data.tar.gz: b3ae4dbec721d9e361f00a91373f40302adc3a58
5
5
  SHA512:
6
- metadata.gz: 3ce2e40b20fa751de2c5075bd9f38e4391c5526bb26dd2b9c12e36feb39709cbdc1df9dab1ab31c581e920dfc5dbb38ef9d7e5c03b7ad1a8bdada1e981d24d1d
7
- data.tar.gz: d08c79d999cbf253ea58bafc636cafb847864085c71cc54e1a85d223395012fb7d1606a7ac71ee0098eebdae4ee8b2071178f8f65e936498f41572d5c4dcc73a
6
+ metadata.gz: cc57ea97ee85e8a069cad1f57556c5e9635b508a8d05b0c0d0bd92190ee92f12bf8e1542848f1e72361aa59227af01193b1b5b23cdb24c928d43fbf88cfcea23
7
+ data.tar.gz: 0c3b44a93be33acb90b94188537b5e739517aba4709a10bf87391436acf9a224d3d8c8960821c3aadd13cc7d416e22338d1832cf0f85a4bd96c5edb2227f43d5
@@ -8,11 +8,9 @@ module EvalExpectationsOnAST
8
8
  def eval_in_gobstones(binding, ast)
9
9
  pattern_generator = expectations[type]
10
10
 
11
- if pattern_generator
12
- !!(ast =~ pattern_generator[binding])
13
- else
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::NegatedInspection
62
- def eval_in_gobstones(binding, ast)
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.0.0
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-02-17 00:00:00.000000000 Z
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.5'
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.5'
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.1
167
+ rubygems_version: 2.4.5
182
168
  signing_key:
183
169
  specification_version: 4
184
170
  summary: XGobstones Runner for Mumuki