nodo 1.8.0 → 1.8.2

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: a7c61ebbcc6843c3be6b1b2cc60a22506d4221a9bf3a013a05a705af775fca08
4
+ data.tar.gz: 04f9c9eec1aae50da93f5bcf53efe8410911b9b926e5928d0b53d079bc7387ca
5
5
  SHA512:
6
- metadata.gz: 877eac53f4eb526c8fc8ef7cc7b10437232a9b50effffd894dda29c36129b33c7a2c9e9edb47964ad2b566ce98c25f38d2866ce0cd0fc52062efbe0084105f31
7
- data.tar.gz: 5aaf9f8097c8a3b7335e1a67b23dc388a194b2dfe395b8b8e0faeca324b194615d1b946fd3a6bf117b0c0d2567c71cae622b00611d772e95f8f35e1e1f519f4a
6
+ metadata.gz: 6b7cc4e7e803592b6d5878822ee561e1dca2344df7af0da10658663e5bfb79b2e65941e697e40106acb72fe6fc9398f1067fee522af005ffd7b6fcfa696801af
7
+ data.tar.gz: d5f6ae394540e9aa7120fb4289f1d968a8f76cacae697ca8e0ba8de90c6cbf4991c9680d7c0b8f961a8300ef8b46ec5557d247481ca54f0e9458185a6f71b2ed
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/errors.rb CHANGED
@@ -48,7 +48,7 @@ module Nodo
48
48
 
49
49
  def format_location(loc)
50
50
  return '' unless loc
51
- loc.inject(' in') { |s, (key, value)| s << " #{key}: #{value}" }
51
+ loc.inject(+' in') { |s, (key, value)| s << " #{key}: #{value}" }
52
52
  end
53
53
  end
54
54
 
data/lib/nodo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nodo
2
- VERSION = '1.8.0'
2
+ VERSION = '1.8.2'
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.2
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-12-10 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: logger
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubygems_version: 3.6.2
64
+ rubygems_version: 3.6.9
65
65
  specification_version: 4
66
66
  summary: Call Node.js from Ruby
67
67
  test_files: []