isomorfeus-puppetmaster 0.6.10 → 0.6.13

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: 5331b7d59ce9feee46bef56dc68b74321621bee8b3a5c365dd1bf318961c7a68
4
- data.tar.gz: 62771a39c950b9048e58328a1907fb896755637c6c69cdc279de5890a0e03834
3
+ metadata.gz: daa437e0662a07334e47cb067440f006bc9fa6015b2fe4f54deb57f1e11e19ee
4
+ data.tar.gz: a4f75f12075a733c14d4e3a0716e4c8b7018d33de39cee4e649bc48f06e4302f
5
5
  SHA512:
6
- metadata.gz: 63c7d55dfc9841cf556e956d4cceb65ec3f6ebeeb59b7eace2757ffa6e1841ebb5e8eab6e72b7a723feb492816d72aa1eeabaa42bd4f8ed1471fa495bb9f9c44
7
- data.tar.gz: d73ae372918c9b65d94085d0fbaa007ac5b249505b76c04924a1f4936639a9db0624371b0cde38f13e8542213349e30f8675ffd59b9d8cc88b1c241d98ee9f70
6
+ metadata.gz: 9e63d3a9f93d812958ff8897a5f56385c4ae940790a3635e1909920d9078ae69c50cb57152646fd76970a02b1c46e71238bcf50bb3b7be59e6de7c2eff3ddb0f
7
+ data.tar.gz: eb1c6e57fc5a4e5cc0b7bdf82a394cd14fdbdfaea540ea52be667c3c2440f0596d04bbf177b3c2eee054d32ae094ef0a3b8ccdaac225f7988e08ecb175321fb8
@@ -9,8 +9,8 @@ class Puppeteer::ExecutionContext
9
9
  catch (e) { return { error: e.name, message: e.message, stack: e.stack }; }
10
10
  }
11
11
  let res = fun();
12
- if (res && res.$to_n) { res = res.$to_n() }
13
- return (res == Opal.nil) ? null : res;
12
+ if (res && res.$to_n) { res = res.$to_n(); }
13
+ return ((res === Opal.nil) ? null : res);
14
14
  }
15
15
  JAVASCRIPT
16
16
  if res.is_a?(Hash) && res.key?('error') && res.key?('message') && res.key?('stack')
@@ -34,8 +34,8 @@ class Puppeteer::ExecutionContext
34
34
  catch (e) { return { error: e.name, message: e.message, stack: e.stack }; }
35
35
  }
36
36
  let res = fun();
37
- if (res && res.$to_n) { res = res.$to_n() }
38
- return (res == Opal.nil) ? null : res;
37
+ if (res && res.$to_n) { res = res.$to_n(); }
38
+ return (res === Opal.nil) ? null : res;
39
39
  }
40
40
  JAVASCRIPT
41
41
  if res.is_a?(Hash) && res.key?('error') && res.key?('message') && res.key?('stack')
@@ -78,7 +78,7 @@ class Puppeteer::ExecutionContext
78
78
  end
79
79
  result, exception = evaluate <<~JAVASCRIPT
80
80
  function () {
81
- var result;
81
+ var res;
82
82
  var exception = false;
83
83
  if (Opal.await_ruby_exception) {
84
84
  var e = Opal.await_ruby_exception;
@@ -87,11 +87,13 @@ class Puppeteer::ExecutionContext
87
87
  let r = Opal.gvars.promise_result;
88
88
  exception = { message: r.$message(), name: r.$class().$name(), stack: r.$backtrace() }
89
89
  } else if (Opal.gvars.promise_result['$respond_to?']('to_n')) {
90
- result = Opal.gvars.promise_result.$to_n()
91
- } else { result = Opal.gvars.promise_result };
90
+ res = Opal.gvars.promise_result.$to_n()
91
+ } else { res = Opal.gvars.promise_result };
92
92
  delete Opal.gvars.promise_result;
93
93
  delete Opal.gvars.promise_resolved;
94
- return [result, exception];
94
+ if (res && res.$to_n) { res = res.$to_n(); }
95
+ res = ((res === Opal.nil) ? null : res);
96
+ return [res, exception];
95
97
  }
96
98
  JAVASCRIPT
97
99
  if exception
@@ -23,6 +23,10 @@ module Isomorfeus
23
23
  'Content-Type' => 'application/json')
24
24
  else
25
25
  begin
26
+ if Isomorfeus.respond_to?(:init_store)
27
+ Isomorfeus.init_store
28
+ Isomorfeus.store.clear! if Isomorfeus.store.respond_to?(:clear!)
29
+ end
26
30
  result = TOPLEVEL_BINDING.eval(request_hash['code']) if request_hash['code']
27
31
  response = Rack::Response.new(Oj.dump({ 'result' => result }),
28
32
  200,
@@ -1,3 +1,3 @@
1
1
  module Isomorfeus
2
- PUPPETMASTER_VERSION = '0.6.10'
2
+ PUPPETMASTER_VERSION = '0.6.13'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-puppetmaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.10
4
+ version: 0.6.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-06 00:00:00.000000000 Z
11
+ date: 2022-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport