gobstones-code-runner 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e573e21d04542a3a3c641184dbde11da4cc41c68fa0bca64a4314936522c72b5
4
- data.tar.gz: 0c76ec7c9017defb7b66268c5f483818576b9f0a8de829dd26adff4339558801
3
+ metadata.gz: d0c61811ba78d55fb716b65f4389a23995138383aad819f094ff891d3091e8ad
4
+ data.tar.gz: 8447f55f82f8bf887d57f0deafa273266468760bf3662d82271f858810da9490
5
5
  SHA512:
6
- metadata.gz: dd5c4dd52aed44d217c2a4187e34d8dfc822fd3e465078f5577f489f235a4e37a5e4a013567787a3fab62ced7ec93f2f41140da66db80dcd6a4d46d194b788e4
7
- data.tar.gz: 35fca0ed6734d05c9d081932fe5c68a02722782f771622c279a4170e1f4e640624cad3b53d234eb81882e277cc4d465aa48ff378d3e344a793d5418e78686950
6
+ metadata.gz: 11852568707822c0da7e0531e880ff51ddcf6c1b7e662500dda9caf2a00c0b56f681b05be2f9ff3e3ccdf184bb921c9a6664a9373f70735a7cbb61722278a605
7
+ data.tar.gz: 0ef4ca18b260d2bd67d6b47b9f15c0ec3c06092bf460eaf2520f2ff69b2ad53ce2a5d15534674a6da01bff418c40c5b1d5746d97dc4c802250a7caacafc0b484
@@ -4174,7 +4174,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
4174
4174
 
4175
4175
  run({ ast, request, throttle, callbacks }) {
4176
4176
  const { states, returnValue, actualReturnValue } = this._interpret(ast, request);
4177
- this._runWithThrottle(states, { returnValue, actualReturnValue }, throttle, callbacks);
4177
+ this._runWithThrottle(states, { returnValue, actualReturnValue }, throttle, request, callbacks);
4178
4178
  }
4179
4179
 
4180
4180
  clear() {
@@ -4182,7 +4182,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
4182
4182
  this.handles = [];
4183
4183
  }
4184
4184
 
4185
- _runWithThrottle(states, { returnValue, actualReturnValue }, throttle, { onResult, onStop, onReturnValue }) {
4185
+ _runWithThrottle(states, { returnValue, actualReturnValue }, throttle, request, { onResult, onStop, onReturnValue }) {
4186
4186
  const _onResult = (state) => onResult(state.board || state, state);
4187
4187
 
4188
4188
  const _onEnd = () => {
@@ -4190,16 +4190,22 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
4190
4190
  onReturnValue(returnValue, actualReturnValue);
4191
4191
  }
4192
4192
 
4193
- if (throttle === 0) {
4194
- const lastState = states[states.length - 1];
4195
- _onResult(lastState);
4196
- return _onEnd();
4197
- }
4198
-
4199
4193
  const firstState = states[0];
4200
4194
  _onResult(firstState);
4201
4195
  if (states.length === 1) return _onEnd();
4202
4196
 
4197
+ if (throttle === 0) {
4198
+ const initialBoardTime = request.initialBoardTime || 0;
4199
+
4200
+ setTimeout(() => {
4201
+ const lastState = states[states.length - 1];
4202
+ _onResult(lastState);
4203
+ _onEnd();
4204
+ }, initialBoardTime);
4205
+
4206
+ return;
4207
+ }
4208
+
4203
4209
  this.handles = states.slice(1).map((state, i) => {
4204
4210
  const ii = i + 1;
4205
4211
 
@@ -1,5 +1,5 @@
1
1
  module Gobstones
2
2
  module CodeRunner
3
- VERSION = "0.9.0"
3
+ VERSION = "0.10.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobstones-code-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
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-01-24 00:00:00.000000000 Z
11
+ date: 2019-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler