multi_process 1.2.1 → 1.3.0

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: 9fa36d18413df27da497f7b827039f6f7316aea6b4d495e7dae6f7824779347a
4
- data.tar.gz: 8aedd68f59d4e596cf905d71214db13693eca5c8bcdbe2ba65a380ad6da8da53
3
+ metadata.gz: 5d62d4ef2d14471f23abcd7c7015d4370acffba45c77007df13505dd96e9fd16
4
+ data.tar.gz: 479e3d12ed873435fcdebe1d8d1d37bab3fbd276f5db85bdb079fa0264bbae27
5
5
  SHA512:
6
- metadata.gz: e86fea763485072ed00773827421524753b11f1e3b4d117dcbd1d0d78d05db78103db141fff9d7d2f229b4e5b5655ab6a6a3d2dddea8f624c9c9ff859abe30cd
7
- data.tar.gz: 1eda65291d33b32948db1114300928341ba783d3e1148b9a633fdd470bc96de049b3944cb8fa47bdbec74e49b1552d61f0d1cd3d61ef1ec3e7b35876d175362e
6
+ metadata.gz: 5865c7397ca0cfcdc7b91c4d1e02f573b85dd63e1b1876074c49d1e5e3595926e6ef9d04d49b0cf0863be3e7c7bdbef814f7fb04a0f389308484847442b699e6
7
+ data.tar.gz: c15f75913b1b3824386430e90202700ff2ac261f3ec09e4db46a52b9d2d639c3eda54102c00e3058bcdca01d1ffde87b4b79febe4d59474d99a86d889ba534e2
data/CHANGELOG.md CHANGED
@@ -6,9 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ### Changed
10
+
11
+ - Use unbundled environment for child processes to support nested bundler invokations by @tylerhunt (#10)
12
+
13
+ ### Fixed
14
+
15
+ - Fix adding a process after the group has been started by @tylerhunt (#11)
16
+
9
17
  ## [1.2.1] - 2024-01-11
10
18
 
11
- ### Added
19
+ ### Fixed
12
20
 
13
21
  - Remove dependency on ActiveSupport by @tylerhunt (#9)
14
22
  - Ruby 3.2
@@ -42,7 +42,7 @@ module MultiProcess
42
42
  processes << process
43
43
  process.receiver = receiver
44
44
 
45
- start process if started?
45
+ process.start if started?
46
46
  end
47
47
  end
48
48
 
@@ -161,7 +161,7 @@ module MultiProcess
161
161
  # Check if environment will be cleaned up for process.
162
162
  #
163
163
  # Currently that includes wrapping the process start in
164
- # `Bundler.with_clean_env` to remove bundler environment
164
+ # `Bundler.with_unbundled_env` to remove bundler environment
165
165
  # variables.
166
166
  #
167
167
  def clean_env?
@@ -218,7 +218,7 @@ module MultiProcess
218
218
  childprocess.cwd = dir
219
219
 
220
220
  if clean_env?
221
- Bundler.with_original_env { childprocess.start }
221
+ Bundler.with_unbundled_env { childprocess.start }
222
222
  else
223
223
  childprocess.start
224
224
  end
@@ -3,8 +3,8 @@
3
3
  module MultiProcess
4
4
  module VERSION
5
5
  MAJOR = 1
6
- MINOR = 2
7
- PATCH = 1
6
+ MINOR = 3
7
+ PATCH = 0
8
8
  STAGE = nil
9
9
  STRING = [MAJOR, MINOR, PATCH, STAGE].compact.join('.')
10
10
 
@@ -40,6 +40,25 @@ describe MultiProcess do
40
40
  expect(Time.now - start).to be < 2
41
41
  end
42
42
 
43
+ it 'starts a process added after the group has been started' do
44
+ reader, writer = IO.pipe
45
+
46
+ logger = MultiProcess::Logger.new writer, collapse: false
47
+ group = MultiProcess::Group.new receiver: logger
48
+ group << MultiProcess::Process.new(%w[ruby spec/files/test.rb 1], title: 'ruby1')
49
+ group.start
50
+ group << MultiProcess::Process.new(%w[ruby spec/files/test.rb 2], title: 'ruby2')
51
+ sleep 1
52
+ group.stop
53
+
54
+ expect(reader.read_nonblock(4096).split("\n")).to match_array <<-OUTPUT.gsub(/^\s+\./, '').split("\n")
55
+ . ruby1 | Output from 1
56
+ . ruby1 | Output from 1
57
+ . ruby2 | Output from 2
58
+ . ruby2 | Output from 2
59
+ OUTPUT
60
+ end
61
+
43
62
  it 'partitions processes' do
44
63
  group = MultiProcess::Group.new partition: 4, receiver: MultiProcess::NilReceiver.new
45
64
  group << MultiProcess::Process.new(%w[ruby sleep.rb 1], dir: 'spec/files', title: 'rubyA')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_process
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-11 00:00:00.000000000 Z
11
+ date: 2024-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: childprocess