isomorfeus-speednode 0.4.5 → 0.4.9

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: 87a39ac56870791f30d5da2cd2421132b54360e732596b487a674fd77985bfb4
4
- data.tar.gz: e9f56a2e8f8596e7757da194b70fe299ec63566472da5e81188a997b6fb54558
3
+ metadata.gz: 6386529e41b6302d4eca02b23e030fdcd9ffdc74133635628b936be45b528116
4
+ data.tar.gz: bdf7a437e537de0f778af542b3ddf3ac152a9ee0e88a9702efe0e2ef73428f9e
5
5
  SHA512:
6
- metadata.gz: d5710791bcc21e6694223d430ef943d526819a7159442003285ab0e12c07cf168856394a2eaf825edd82aca5d96b3da609322694237d9cbb069e4a25d97ddf63
7
- data.tar.gz: 1dac21aab4f330ba546ae5389facd15858120109ae7996b955108c39bbb004f72ca612c63c8fd78b485c4a723fd9c03ddc6bdeddaf87766f92b213090c51e37a
6
+ metadata.gz: 1f0685793f799e6dc50794c02d68ba5676e01d67f0fd4fcf788c998540fe136b81eaa84ce252928ca1add83f0e00f5e3784dcb6de3af74f057060b3b65f66c41
7
+ data.tar.gz: b658cb58bcac9a2c7888799a76d32486d25fa6767ace2b9be86ac012a54b4566251b62dc615cab906003614e95b7d5cddbf3bf6e1e46261646a76b0e37392d66
data/README.md CHANGED
@@ -7,7 +7,7 @@ A fast runtime for execjs using node js. Works on Linux, BSDs, MacOS and Windows
7
7
  Inspired by [execjs-fastnode](https://github.com/jhawthorn/execjs-fastnode).
8
8
 
9
9
  ### Community and Support
10
- At the [Isomorfeus Framework Project](http://isomorfeus.com)
10
+ At the [Isomorfeus Framework Project](https://isomorfeus.com)
11
11
 
12
12
  ### Installation
13
13
 
@@ -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 node],
5
+ command: %w[node nodejs],
6
6
  runner_path: File.join(File.dirname(__FILE__), 'speednode', 'runner.js'),
7
7
  encoding: 'UTF-8'
8
8
  )
@@ -110,7 +110,7 @@ module Isomorfeus
110
110
  extract_result(result)
111
111
  end
112
112
 
113
- def extract_result(output)
113
+ def extract_result(output)
114
114
  if output[0] == 'ok'
115
115
  output[1]
116
116
  else
@@ -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
- command("deleteContext", context)
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,14 +126,10 @@ module Isomorfeus
122
126
  @socket_dir = nil
123
127
  @socket_path = SecureRandom.uuid
124
128
  else
125
- @socket_dir = Dir.mktmpdir("isomorfeus-speednode-")
129
+ @socket_dir = Dir.mktmpdir("iso-speednode-")
126
130
  @socket_path = File.join(@socket_dir, "socket")
127
131
  end
128
- @pid = if @options.key?(:source_maps)
129
- Process.spawn({"SOCKET_PATH" => @socket_path}, @options[:binary], @options[:source_maps], @options[:runner_path])
130
- else
131
- Process.spawn({"SOCKET_PATH" => @socket_path}, @options[:binary], @options[:runner_path])
132
- end
132
+ @pid = Process.spawn({"SOCKET_PATH" => @socket_path}, @options[:binary], @options[:source_maps], @options[:runner_path])
133
133
 
134
134
  retries = 100
135
135
 
@@ -22,11 +22,7 @@ module Isomorfeus
22
22
  @encoding = options[:encoding]
23
23
  @deprecated = !!options[:deprecated]
24
24
 
25
- @vm = if Gem::Platform.local.cpu.start_with?('arm')
26
- VM.new(binary: @binary, runner_path: @runner_path)
27
- else
28
- VM.new(binary: @binary, source_maps: '--enable-source-maps', runner_path: @runner_path)
29
- end
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
1
  module Isomorfeus
2
2
  module Speednode
3
- VERSION = '0.4.5'
3
+ VERSION = '0.4.9'
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.4.5
4
+ version: 0.4.9
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-19 00:00:00.000000000 Z
11
+ date: 2022-02-08 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.9
33
+ version: 3.13.11
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.9
40
+ version: 3.13.11
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: win32-pipe
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -130,11 +130,12 @@ files:
130
130
  - lib/isomorfeus/speednode/runtime/vm.rb
131
131
  - lib/isomorfeus/speednode/runtime/vm_command.rb
132
132
  - lib/isomorfeus/speednode/version.rb
133
- homepage: http://isomorfeus.com
133
+ homepage: https://isomorfeus.com
134
134
  licenses:
135
135
  - MIT
136
136
  metadata:
137
137
  github_repo: ssh://github.com/isomorfeus/gems
138
+ source_code_uri: https://github.com/isomorfeus/isomorfeus-speednode
138
139
  post_install_message:
139
140
  rdoc_options: []
140
141
  require_paths:
@@ -143,14 +144,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
143
144
  requirements:
144
145
  - - ">="
145
146
  - !ruby/object:Gem::Version
146
- version: '0'
147
+ version: 3.1.0
147
148
  required_rubygems_version: !ruby/object:Gem::Requirement
148
149
  requirements:
149
150
  - - ">="
150
151
  - !ruby/object:Gem::Version
151
152
  version: '0'
152
153
  requirements: []
153
- rubygems_version: 3.2.22
154
+ rubygems_version: 3.3.3
154
155
  signing_key:
155
156
  specification_version: 4
156
157
  summary: A fast ExecJS runtime based on nodejs, tuned for Isomorfeus.