isomorfeus-speednode 0.4.4 → 0.4.8
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/README.md +8 -8
- data/lib/isomorfeus/execjs_runtimes.rb +1 -1
- data/lib/isomorfeus/speednode/runtime/context.rb +1 -1
- data/lib/isomorfeus/speednode/runtime/vm.rb +7 -3
- data/lib/isomorfeus/speednode/runtime.rb +1 -5
- data/lib/isomorfeus/speednode/version.rb +5 -5
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 788d541d9b3bc3d879bac905fa1bb3750cc4acf8a6e0612e62f4df6f2319dc27
|
4
|
+
data.tar.gz: 3e42a0ddf03ec1f630b1a502e55d6b3531da0fb66151e509c03b487c0b7995ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 581b8293834f43968542b19ce1ab95a9fa0c8c2e464acbf253596d25e254d769c89cf32ede7b32d01a218dc5fb029240edfd7167f69dcc1dab3994b806140fcb
|
7
|
+
data.tar.gz: b58b3221aefbf65451d2cd537fe0ede4b77470ea8ccf2712b26fff65beaa372fa008c51259f0666eb0c160d4890b0f250367b7715f7bfa9ed9c4edaba0b980f2
|
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
|
1
|
+
<h1 align="center">
|
2
|
+
<img src="https://github.com/isomorfeus/isomorfeus-speednode/blob/master/Logo.png?raw=true" align="center" width="234" height="127"/><br/>
|
3
|
+
Isomorfeus Speednode<br/>
|
4
|
+
</h1>
|
2
5
|
|
3
6
|
A fast runtime for execjs using node js. Works on Linux, BSDs, MacOS and Windows.
|
4
7
|
Inspired by [execjs-fastnode](https://github.com/jhawthorn/execjs-fastnode).
|
5
8
|
|
6
9
|
### Community and Support
|
7
|
-
At the [Isomorfeus Framework Project](http://isomorfeus.com)
|
8
|
-
|
9
|
-
### Tested
|
10
|
-
[TravisCI](https://travis-ci.org): [](https://travis-ci.org/isomorfeus/isomorfeus-speednode)
|
10
|
+
At the [Isomorfeus Framework Project](http://isomorfeus.com)
|
11
11
|
|
12
12
|
### Installation
|
13
13
|
|
@@ -40,8 +40,8 @@ Example for a compatible context:
|
|
40
40
|
compat_context = ExecJS.compile('Test = "test"')
|
41
41
|
compat_context.eval('1+1')
|
42
42
|
```
|
43
|
-
#### Permissive
|
44
|
-
A permissive context can be created with `ExecJS.permissive_compile` or code can be executed within a permissive context by using
|
43
|
+
#### Permissive
|
44
|
+
A permissive context can be created with `ExecJS.permissive_compile` or code can be executed within a permissive context by using
|
45
45
|
`ExecJS.permissive_eval` or `ExecJS.permissive_exec`.
|
46
46
|
Example for a permissive context:
|
47
47
|
```ruby
|
@@ -63,7 +63,7 @@ context.eval <<~JAVASCRIPT
|
|
63
63
|
return new Promise(function (resolve, reject) { resolve(val); });
|
64
64
|
}
|
65
65
|
JAVASCRIPT
|
66
|
-
|
66
|
+
|
67
67
|
context.await("foo('test')") # => 'test'
|
68
68
|
```
|
69
69
|
|
@@ -2,7 +2,7 @@ module ExecJS
|
|
2
2
|
module Runtimes
|
3
3
|
Speednode = Isomorfeus::Speednode::Runtime.new(
|
4
4
|
name: 'Isomorfeus Speednode Node.js (V8)',
|
5
|
-
command: %w[nodejs
|
5
|
+
command: %w[node nodejs],
|
6
6
|
runner_path: File.join(File.dirname(__FILE__), 'speednode', 'runner.js'),
|
7
7
|
encoding: 'UTF-8'
|
8
8
|
)
|
@@ -44,7 +44,7 @@ module Isomorfeus
|
|
44
44
|
attr_reader :responder
|
45
45
|
|
46
46
|
def initialize(options)
|
47
|
-
@mutex = Mutex.new
|
47
|
+
@mutex = Thread::Mutex.new
|
48
48
|
@socket_path = nil
|
49
49
|
@options = options
|
50
50
|
@started = false
|
@@ -101,7 +101,11 @@ module Isomorfeus
|
|
101
101
|
end
|
102
102
|
|
103
103
|
def delete_context(context)
|
104
|
-
|
104
|
+
@mutex.synchronize do
|
105
|
+
VMCommand.new(@socket, "deleteContext", [context]).execute rescue nil
|
106
|
+
end
|
107
|
+
rescue ThreadError
|
108
|
+
nil
|
105
109
|
end
|
106
110
|
|
107
111
|
# def context_options(context)
|
@@ -122,7 +126,7 @@ module Isomorfeus
|
|
122
126
|
@socket_dir = nil
|
123
127
|
@socket_path = SecureRandom.uuid
|
124
128
|
else
|
125
|
-
@socket_dir = Dir.mktmpdir("
|
129
|
+
@socket_dir = Dir.mktmpdir("iso-speednode-")
|
126
130
|
@socket_path = File.join(@socket_dir, "socket")
|
127
131
|
end
|
128
132
|
@pid = Process.spawn({"SOCKET_PATH" => @socket_path}, @options[:binary], @options[:source_maps], @options[:runner_path])
|
@@ -22,11 +22,7 @@ module Isomorfeus
|
|
22
22
|
@encoding = options[:encoding]
|
23
23
|
@deprecated = !!options[:deprecated]
|
24
24
|
|
25
|
-
@vm = VM.new(
|
26
|
-
binary: @binary,
|
27
|
-
source_maps: '--enable-source-maps',
|
28
|
-
runner_path: @runner_path
|
29
|
-
)
|
25
|
+
@vm = VM.new(binary: @binary, source_maps: '--enable-source-maps', runner_path: @runner_path)
|
30
26
|
|
31
27
|
@popen_options = {}
|
32
28
|
@popen_options[:external_encoding] = @encoding if @encoding
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module Isomorfeus
|
2
|
-
module Speednode
|
3
|
-
VERSION = '0.4.
|
4
|
-
end
|
5
|
-
end
|
1
|
+
module Isomorfeus
|
2
|
+
module Speednode
|
3
|
+
VERSION = '0.4.8'
|
4
|
+
end
|
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.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.13.
|
33
|
+
version: 3.13.10
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.13.
|
40
|
+
version: 3.13.10
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: win32-pipe
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,14 +143,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
requirements:
|
144
144
|
- - ">="
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version:
|
146
|
+
version: 3.1.0
|
147
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
149
|
- - ">="
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
|
-
rubygems_version: 3.
|
153
|
+
rubygems_version: 3.3.3
|
154
154
|
signing_key:
|
155
155
|
specification_version: 4
|
156
156
|
summary: A fast ExecJS runtime based on nodejs, tuned for Isomorfeus.
|