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 +4 -4
- data/CHANGELOG.md +9 -1
- data/lib/multi_process/group.rb +1 -1
- data/lib/multi_process/process.rb +2 -2
- data/lib/multi_process/version.rb +2 -2
- data/spec/multi_process_spec.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d62d4ef2d14471f23abcd7c7015d4370acffba45c77007df13505dd96e9fd16
|
4
|
+
data.tar.gz: 479e3d12ed873435fcdebe1d8d1d37bab3fbd276f5db85bdb079fa0264bbae27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
###
|
19
|
+
### Fixed
|
12
20
|
|
13
21
|
- Remove dependency on ActiveSupport by @tylerhunt (#9)
|
14
22
|
- Ruby 3.2
|
data/lib/multi_process/group.rb
CHANGED
@@ -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.
|
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.
|
221
|
+
Bundler.with_unbundled_env { childprocess.start }
|
222
222
|
else
|
223
223
|
childprocess.start
|
224
224
|
end
|
data/spec/multi_process_spec.rb
CHANGED
@@ -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.
|
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
|
+
date: 2024-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: childprocess
|