mumuki-gobstones-runner 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/checker.rb +5 -1
  3. data/lib/version_hook.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba2ba3ad0ac2a0fe242c7a5ac0be73e6abfe0cd59e605fa763620e6b086cabad
4
- data.tar.gz: 88044e138b6b6a208c2047479a0f44166fa9de72c0cdcf061ff67e1afd905e64
3
+ metadata.gz: f44adc9fe38060062bccce5f76013a2dc72c7250945fc5752fd4f3cdbf2e88cc
4
+ data.tar.gz: 48b3344ff040307cdce4f4b52482de950bd020ff6d9b6653b64d1a40165ea64e
5
5
  SHA512:
6
- metadata.gz: f8f1b910a07058d709e8e590193e3c124701d68f2ac3ff24034b1a7aa96546fec0649db037c57894c3f4d85f9ac93b804c8a3aec4a7ac8b2f1587021e26347e8
7
- data.tar.gz: 73c81f0a3366f144132e243f16cee9fc97dd614f6a26cf08ea8e07e8e88947d9e39e42a76cd56c5dcdc61832d062d9396b49cfae51dc55dfe419a7b3d9807826
6
+ metadata.gz: de465e0e24873c663f402fc24af2929f3ae31ce035dcda624895816e2341b4234404059e8e99599bcd09ba1bf2768d842f7ceb4f32beb7f457e2fdc2f0ba0574
7
+ data.tar.gz: 150f956d8eb244b5a9d71a88d43f1f68e8854596e7e65323cf499104e7f31b620bb0ce5dc022ead09a994aff64e4da2ed7a1a7c24272eccd7a9ef1a79604f22c
data/lib/checker.rb CHANGED
@@ -113,12 +113,16 @@ module Gobstones
113
113
  return "no_stones" if code == 'cannot-remove-stone'
114
114
  return "out_of_board" if code == 'cannot-move-to'
115
115
  return "unassigned_variable" if code == 'undefined-variable'
116
- return "wrong_argument_type" if code.include? 'type-mismatch'
116
+ return "wrong_argument_type" if has_wrong_argument_type? code
117
117
  return "wrong_arguments_quantity" if code.include? 'arity-mismatch'
118
118
 
119
119
  code
120
120
  end
121
121
 
122
+ def has_wrong_argument_type?(code)
123
+ code.match Regexp.union('type-mismatch', 'expected-value-of-type')
124
+ end
125
+
122
126
  def adapt_value(return_value)
123
127
  type = return_value[:type]
124
128
  value = return_value[:value]
data/lib/version_hook.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module GobstonesVersionHook
2
- VERSION = '2.0.0'
2
+ VERSION = '2.0.1'
3
3
  end
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: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Alfonso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-26 00:00:00.000000000 Z
11
+ date: 2019-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  requirements: []
211
- rubygems_version: 3.0.2
211
+ rubygems_version: 3.0.3
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: Gobstones Runner for Mumuki