isomorfeus-puppetmaster 0.6.15 → 0.6.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isomorfeus/puppeteer/execution_context.rb +1 -1
- data/lib/isomorfeus/puppetmaster/server/executor_middleware.rb +2 -2
- data/lib/isomorfeus/puppetmaster/server.rb +1 -1
- data/lib/isomorfeus/puppetmaster/version.rb +1 -1
- data/lib/isomorfeus-puppetmaster.rb +3 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7d963bc338bbbb2ecf4a64a2a7352a7a42280438f177a8b6462dbe2189e8245
|
4
|
+
data.tar.gz: d282a11b84d54e9e30a2928785c7ca8704343cc21dfaa16bc464d9da149bae56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5588e6d58f1459a07aa433d097ec36d4c34467a9f414a94d08662ebbc787d9bd579b624dcbf1e1bd88b6839468e1ecedb21e95d770c7e87db979265446b0d4c8
|
7
|
+
data.tar.gz: 85266b7bd52a7e064ae15c456dbd31d4ba488df2cddcc9ac9e25d6093ac0858f5d44acb1781a592e51a6eaa4affd1aa0b6bccb7d20d2599dae45f028f17d360f
|
@@ -48,7 +48,7 @@ class Puppeteer::ExecutionContext
|
|
48
48
|
|
49
49
|
def await_ruby(ruby_source = '', &block)
|
50
50
|
ruby_source = Isomorfeus::Puppetmaster.block_source_code(&block) if block_given?
|
51
|
-
ruby_source = "#{ruby_source}.
|
51
|
+
ruby_source = "#{ruby_source}.always { |result| $promise_result = result; $promise_resolved = true }"
|
52
52
|
compiled_ruby = Isomorfeus::Puppetmaster.compile_ruby_source(ruby_source)
|
53
53
|
evaluate <<~JAVASCRIPT
|
54
54
|
function(){
|
@@ -18,7 +18,6 @@ module Isomorfeus
|
|
18
18
|
unless request.body.nil?
|
19
19
|
request_hash = Oj.load(request.body.read, mode: :strict)
|
20
20
|
if request_hash['key'] != @@request_key
|
21
|
-
STDERR.puts "wrong key"
|
22
21
|
response = Rack::Response.new(Oj.dump({ 'error' => 'wrong key given, execution denied' }),
|
23
22
|
401,
|
24
23
|
'Content-Type' => 'application/json')
|
@@ -29,7 +28,8 @@ module Isomorfeus
|
|
29
28
|
Isomorfeus.store.clear! if Isomorfeus.store.respond_to?(:clear!)
|
30
29
|
end
|
31
30
|
result = TOPLEVEL_BINDING.eval(request_hash['code']) if request_hash['code']
|
32
|
-
|
31
|
+
result = result.value if result.is_a?(Promise)
|
32
|
+
response = Rack::Response.new(Oj.dump({ 'result' => result }, circular: true),
|
33
33
|
200,
|
34
34
|
'Content-Type' => 'application/json')
|
35
35
|
rescue Exception => e
|
@@ -85,7 +85,7 @@ module Isomorfeus
|
|
85
85
|
http.post('/__executor__', Oj.dump(request_hash, mode: :strict))
|
86
86
|
end
|
87
87
|
if response.code == '200'
|
88
|
-
result_hash = Oj.load(response.body)
|
88
|
+
result_hash = Oj.load(response.body, circular: true)
|
89
89
|
if result_hash.key?('error')
|
90
90
|
error = RuntimeError.new(result_hash['error'])
|
91
91
|
error.set_backtrace(result_hash['backtrace'])
|
@@ -5,6 +5,9 @@ require 'uri'
|
|
5
5
|
require 'net/http'
|
6
6
|
require 'rack'
|
7
7
|
require 'opal'
|
8
|
+
opal_path = Gem::Specification.find_by_name('opal').full_gem_path
|
9
|
+
promise_path = File.join(opal_path, 'stdlib', 'promise.rb')
|
10
|
+
require promise_path
|
8
11
|
require 'parser'
|
9
12
|
|
10
13
|
# isomorfeus needs kwargs
|
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.
|
4
|
+
version: 0.6.18
|
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-
|
11
|
+
date: 2022-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -92,14 +92,14 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 0.
|
95
|
+
version: 0.42.0
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0.
|
102
|
+
version: 0.42.0
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: tty-which
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|