isomorfeus-speednode 0.2.11 → 0.2.12

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
  SHA256:
3
- metadata.gz: 917120184f53418bf061f3fbb7020f9ebbfd33ddc24475f06544aca2b8787b2a
4
- data.tar.gz: 9c1e6cdc8c62dbf4db3d1bb27bad4b392ff520de3ca2c76586eec3ce9c43bb50
3
+ metadata.gz: 47b388ff399cb8efb905e876ff5a6b48ea538633db1fbe9a8602f1083f11858b
4
+ data.tar.gz: ac6bd1e76e66ab17df66a6d92c1d3aa92f333427bcff0b6d41a3f9b27e967c45
5
5
  SHA512:
6
- metadata.gz: 4e6d3aa1bc6654ac85c39681fb71ce699174fa6c65366a91732fff9d3a8f3f2fef6c967f080e17e94b3af1215764d2d978e23666ffa44521a01d100d42d1c6e3
7
- data.tar.gz: db5a4fcab7ce656f507f1674e397c9a084867b24353c4ffabe294c33694234c86a85d5b9e737d9f8b88a373daa059b0a30e03f5cd5ece4e8a4c52d51a702280b
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 = Buffer.alloc(0);
200
+ let received_data = [];
201
201
 
202
202
  s.on('data', function (data) {
203
- received_data = Buffer.concat([received_data, data]);
204
- if (received_data[received_data.length - 1] !== 4) { return; }
205
- let request = received_data.slice(0, received_data.length - 1).toString('utf8');
206
- received_data = Buffer.alloc(0);
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 = CircularJSON.stringify(result);
216
- } else { outputJSON = JSON.stringify(['err', '' + err, err.stack]); }
217
- }
218
- s.write(outputJSON + '\x04');
219
- if (process_exit !== false) { process.exit(process_exit); }
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 = {})
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Speednode
3
- VERSION = '0.2.11'
3
+ VERSION = '0.2.12'
4
4
  end
5
5
  end
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.11
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: 2019-10-21 00:00:00.000000000 Z
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: