diffux_ci 0.4.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 655dc75096ce2012e0e6f1ccd231d57c086d4d7b
4
- data.tar.gz: 8f3a8617e9b91e630efd7c8ba79b323dcff33c2f
3
+ metadata.gz: d71ccdac8e66bd426e7ddb84f4d09423780606d7
4
+ data.tar.gz: 0adf694bcf203f34bb8dc87b08e79c596c68d80f
5
5
  SHA512:
6
- metadata.gz: f6f420363c7def23d0115ebc21a12782f68c2863a7888a423cc15342a4c86d882f00779b379b34b3b585bbe36ead7033c98f042f47f537cc4201286af60ad6eb
7
- data.tar.gz: 9497fc103436f030f9b2978496707e6ad4be3de35fc6cbfc7da9650203e149b8359f6eeaffc26402a59006829cc00cd7dd60647401b4338c60286ef8a5279c02
6
+ metadata.gz: 778314460045c284beeb1eab8446e58c8f95d5619220c2d2c6887ff121b095cb73bbfbd7891055c32c3dc5ff4e2454551447119c2b2aeacfa3c164d81b0d89d0
7
+ data.tar.gz: 4f242e480d4a70d4aa098b2a1ea29ec0bc8cf32128b952c48e419ec7f8b1e77092b38a50a57e9df23358ca5e92c402cad3afa0c158f46d4e2d48cad00577b041
@@ -44,7 +44,7 @@ window.diffux = {
44
44
  },
45
45
 
46
46
  handleError: function(currentExample, error) {
47
- console.error(error);
47
+ console.error(error.stack);
48
48
  return {
49
49
  description: currentExample.description,
50
50
  error: error.message
@@ -132,8 +132,21 @@ window.diffux = {
132
132
  } else {
133
133
  // The function does not take an argument, so we can run it
134
134
  // synchronously.
135
- var elem = func();
136
- doneFunc(this.processElem(currentExample, elem));
135
+ var result = func();
136
+
137
+ if (result instanceof Promise) {
138
+ // The function returned a promise, so we need to wait for it to
139
+ // resolve before proceeding.
140
+ result.then(function(elem) {
141
+ doneFunc(this.processElem(currentExample, elem));
142
+ }.bind(this)).catch(function(error) {
143
+ doneFunc(this.handleError(currentExample, error));
144
+ }.bind(this));
145
+ } else {
146
+ // The function did not return a promise, so we assume it gave us an
147
+ // element that we can process immediately.
148
+ doneFunc(this.processElem(currentExample, result));
149
+ }
137
150
  }
138
151
  } catch (error) {
139
152
  doneFunc(this.handleError(currentExample, error));
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  module DiffuxCI
3
- VERSION = '0.4.4'
3
+ VERSION = '0.5.0'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diffux_ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henric Trotzig
@@ -149,7 +149,6 @@ files:
149
149
  - lib/diffux_ci/views/debug.erb
150
150
  - lib/diffux_ci/views/index.erb
151
151
  - lib/diffux_ci/views/review.erb
152
- - lib/public/diffux_ci-scripts.js
153
152
  homepage: http://rubygems.org/gems/diffux_ci
154
153
  licenses:
155
154
  - MIT
@@ -1,5 +0,0 @@
1
- $(function() {
2
- $('.js-diff').each(function(elem) {
3
- var $elem = $(elem);
4
- });
5
- });