isomorfeus-speednode 0.2.11 → 0.2.12
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 +4 -4
- data/lib/isomorfeus/speednode/runner.js +12 -13
- data/lib/isomorfeus/speednode/runtime.rb +2 -6
- data/lib/isomorfeus/speednode/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47b388ff399cb8efb905e876ff5a6b48ea538633db1fbe9a8602f1083f11858b
|
4
|
+
data.tar.gz: ac6bd1e76e66ab17df66a6d92c1d3aa92f333427bcff0b6d41a3f9b27e967c45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb15b4d6b5ff6251a5286d3aa8612fe4ab107b010f61546e4ce186a9f2969d58b5533368e1ae064755d512af73716f3f3e3dddf30592048095de494d3a7749a
|
7
|
+
data.tar.gz: b758f28b4c24a186eb4ea1fccacd37e48ff4b27306c49e8038375b59199f91e8fd1c8dec8a6a7783385c4f0b1a819ee8be42570689cccc65e0a74a040b119e63
|
@@ -197,27 +197,26 @@ let commands = {
|
|
197
197
|
};
|
198
198
|
|
199
199
|
let server = net.createServer(function(s) {
|
200
|
-
let received_data =
|
200
|
+
let received_data = [];
|
201
201
|
|
202
202
|
s.on('data', function (data) {
|
203
|
-
received_data
|
204
|
-
if (
|
205
|
-
let request = received_data.
|
206
|
-
|
207
|
-
|
203
|
+
received_data.push(data);
|
204
|
+
if (data[data.length - 1] !== 4) { return; }
|
205
|
+
let request = received_data.join('').toString('utf8');
|
206
|
+
request = request.substr(0, request.length - 1);
|
207
|
+
received_data = [];
|
208
208
|
let input = JSON.parse(request);
|
209
209
|
let result = commands[input.cmd].apply(null, input.args);
|
210
210
|
let outputJSON = '';
|
211
211
|
|
212
212
|
try { outputJSON = JSON.stringify(result); }
|
213
213
|
catch(err) {
|
214
|
-
if (err.message.includes('circular')) {
|
215
|
-
outputJSON =
|
216
|
-
}
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
});
|
214
|
+
if (err.message.includes('circular')) { outputJSON = CircularJSON.stringify(result); }
|
215
|
+
else { outputJSON = JSON.stringify(['err', '' + err, err.stack]); }
|
216
|
+
}
|
217
|
+
s.write(outputJSON + '\x04');
|
218
|
+
if (process_exit !== false) { process.exit(process_exit); }
|
219
|
+
});
|
221
220
|
});
|
222
221
|
|
223
222
|
let socket_path = process.env.SOCKET_PATH;
|
@@ -128,9 +128,7 @@ module Isomorfeus
|
|
128
128
|
end
|
129
129
|
|
130
130
|
def eval(source, options = {})
|
131
|
-
if /\S/ =~ source
|
132
|
-
raw_exec("(#{source})")
|
133
|
-
end
|
131
|
+
raw_exec("(#{source})") if /\S/ =~ source
|
134
132
|
end
|
135
133
|
|
136
134
|
def exec(source, options = {})
|
@@ -142,9 +140,7 @@ module Isomorfeus
|
|
142
140
|
end
|
143
141
|
|
144
142
|
def permissive_eval(source, options = {})
|
145
|
-
if /\S/ =~ source
|
146
|
-
raw_execp("(#{source})")
|
147
|
-
end
|
143
|
+
raw_execp("(#{source})") if /\S/ =~ source
|
148
144
|
end
|
149
145
|
|
150
146
|
def permissive_exec(source, options = {})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-speednode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|
@@ -99,7 +99,8 @@ files:
|
|
99
99
|
homepage: http://isomorfeus.com
|
100
100
|
licenses:
|
101
101
|
- MIT
|
102
|
-
metadata:
|
102
|
+
metadata:
|
103
|
+
github_repo: ssh://github.com/isomorfeus/gems
|
103
104
|
post_install_message:
|
104
105
|
rdoc_options: []
|
105
106
|
require_paths:
|