nodo 1.8.0 → 1.8.1

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: e7c1002efcf0b7ba146dde5e10af7ddcdfdfeb450824dfaf5cce56c115630303
4
- data.tar.gz: 3dc41a17980258b0ef634bb6a05319cc98501495ebb7a4688007cd0546f32fb3
3
+ metadata.gz: 50f955c1543aab886f5da57ffa11eafcd600d69faa7b783bd947f88982407982
4
+ data.tar.gz: 2600178935813941c441f72c931cfbd83873bd927d12a1c87128db4ee1f827b7
5
5
  SHA512:
6
- metadata.gz: 877eac53f4eb526c8fc8ef7cc7b10437232a9b50effffd894dda29c36129b33c7a2c9e9edb47964ad2b566ce98c25f38d2866ce0cd0fc52062efbe0084105f31
7
- data.tar.gz: 5aaf9f8097c8a3b7335e1a67b23dc388a194b2dfe395b8b8e0faeca324b194615d1b946fd3a6bf117b0c0d2567c71cae622b00611d772e95f8f35e1e1f519f4a
6
+ metadata.gz: e7532dcb62426fe8a8718134256aae2b32c551421c78f45b47a0ab2b57a614cba9999bd6232eeaf0817fbed27b5a25dac8237646bd265b80d577c53ee5521282
7
+ data.tar.gz: c1d108e0e17b17427dcd4420d34bd8174dbc32e8fd69b3500ab22b1131beaa6de960d88378723a50f3e8d20a3f7099d593a1a5573791e0a9b7e436af2b042be5
data/README.md CHANGED
@@ -28,7 +28,8 @@ gem 'nodo'
28
28
 
29
29
  Nodo requires a working installation of Node.js.
30
30
 
31
- If the executable is located in your `PATH`, no configuration is required. Otherwise, the path to to binary can be set using:
31
+ If the executable is located in your `PATH`, no configuration is required.
32
+ Otherwise, the path to the binary can be set using:
32
33
 
33
34
  ```ruby
34
35
  Nodo.binary = '/usr/local/bin/node'
@@ -381,3 +382,18 @@ option:
381
382
  ```ruby
382
383
  WebMock.disable_net_connect!(allow_localhost: true)
383
384
  ```
385
+
386
+ ## Node process options
387
+
388
+ Extra commandline arguments to the `node` binary can be supplied in standard
389
+ [`Process::spawn` array form](https://docs.ruby-lang.org/en/master/Process.html#method-c-spawn):
390
+
391
+ ```ruby
392
+ Nodo.args = %w[--enable-source-maps]
393
+ ```
394
+
395
+ Environment variables to be supplied to the `node` process can be set using:
396
+
397
+ ```ruby
398
+ Nodo.env = { 'NAME' => 'value' }
399
+ ```
data/lib/nodo/core.rb CHANGED
@@ -211,7 +211,7 @@ module Nodo
211
211
  @@tmpdir = Pathname.new(Dir.mktmpdir('nodo'))
212
212
  env = Nodo.env.merge('NODE_PATH' => Nodo.modules_root.to_s)
213
213
  env['NODO_DEBUG'] = '1' if Nodo.debug
214
- @@node_pid = Process.spawn(env, Nodo.binary, '-e', self.class.generate_core_code, '--', socket_path.to_s, err: :out)
214
+ @@node_pid = Process.spawn(env, Nodo.binary, '-e', self.class.generate_core_code, *Nodo.args, '--', socket_path.to_s, err: :out)
215
215
  at_exit do
216
216
  @@exiting = true
217
217
  Process.kill(:SIGTERM, node_pid) rescue Errno::ECHILD
data/lib/nodo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nodo
2
- VERSION = '1.8.0'
2
+ VERSION = '1.8.1'
3
3
  end
data/lib/nodo.rb CHANGED
@@ -9,11 +9,12 @@ require 'forwardable'
9
9
 
10
10
  module Nodo
11
11
  class << self
12
- attr_accessor :modules_root, :env, :binary, :logger, :debug, :timeout
12
+ attr_accessor :modules_root, :env, :binary, :args, :logger, :debug, :timeout
13
13
  end
14
14
  self.modules_root = './node_modules'
15
15
  self.env = {}
16
16
  self.binary = 'node'
17
+ self.args = nil
17
18
  self.logger = Logger.new(STDOUT)
18
19
  self.debug = false
19
20
  self.timeout = 60
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nodo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Grosser
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-05 00:00:00.000000000 Z
10
+ date: 2025-08-25 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: logger