process_executer 3.2.0 → 3.2.3

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: 3af694308b0e9c5119b2ff63d11b6b351a25cc9f7d66ac2dd482c8525736595a
4
- data.tar.gz: a669d2c3cceadeb7544be9765793eff22addc8c7bde10e13e4d36de447b26cb5
3
+ metadata.gz: 2000a0333ebf2ac629edac374ca29355a557c05e512783570b650738c439719c
4
+ data.tar.gz: 0347f4f0a06370cfbfd4e4240947cf940879acecc6d072fad77711bb04598125
5
5
  SHA512:
6
- metadata.gz: 670dcd425f0879def69e0875a90edae0f79280b44d4ea73d117b3875ad3eeb1cd6329f4b2d8a6a8c0d601f7b79eb72989288255d57067714f2e830f4dde3ddb2
7
- data.tar.gz: 6a18db9777ecb26ebaa7b30c3fbadb81ae8adba1dcd60c92bf6d30510f30275336ef34c4b1c05c5df6356bcd62cd5b783736adb25462dd55d9d87deec6015945
6
+ metadata.gz: 4553524b57e82b0a601f94d84e2f4dcda5e0ffc761774d95a083673fcd0eb56fd8608a4124d1fdf84a7d815220f57f0c8753f60f85d3754ae2bfb486b0666d36
7
+ data.tar.gz: bd5516506787274bf2a9baf3b20b2738bde3b71c4874f024e457e08dfad49070204bec7c8ee4aec01113db113397a9c17a15f86184dc8e7f03f80ae8da68e8e1
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "3.2.3"
3
+ }
data/CHANGELOG.md CHANGED
@@ -5,6 +5,33 @@ All notable changes to the process_executer gem will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.2.3](https://github.com/main-branch/process_executer/compare/v3.2.2...v3.2.3) (2025-04-17)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Do not trigger build workflows after merging to main or for release PRs ([0b2701c](https://github.com/main-branch/process_executer/commit/0b2701c4eef8ecc929f9f987433599145b224256))
14
+
15
+ ## [3.2.2](https://github.com/main-branch/process_executer/compare/v3.2.1...v3.2.2) (2025-04-16)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * Automate commit-to-publish workflow ([c51e8d2](https://github.com/main-branch/process_executer/commit/c51e8d2dfcff21ccd634fe58d5eb3b733869877d))
21
+
22
+ ## v3.2.1 (2025-04-08)
23
+
24
+ [Full Changelog](https://github.com/main-branch/process_executer/compare/v3.2.0..v3.2.1)
25
+
26
+ Changes since v3.2.0:
27
+
28
+ * d1e19a5 test: assert that MonitoredPipe has no open instances after each test
29
+ * aa71f8e test: ensure MonitoredPipe cleans up open instances in specs
30
+ * 987b0c9 fix: ensure that all pipes are closed even when there is an IOError
31
+ * 65e8db0 fix: ensure that MonitoredPipe cleans up after itself even when there is IOError
32
+ * ed2454e chore: integrate track_open_instances gem to report on leaked MonitoredPipe instances
33
+ * f25c87d chore: release v3.2.0
34
+
8
35
  ## v3.2.0 (2025-04-04)
9
36
 
10
37
  [Full Changelog](https://github.com/main-branch/process_executer/compare/v3.1.0..v3.2.0)
data/README.md CHANGED
@@ -4,8 +4,6 @@
4
4
  [![Documentation](https://img.shields.io/badge/Documentation-Latest-green)](https://rubydoc.info/gems/process_executer/)
5
5
  [![Change Log](https://img.shields.io/badge/CHANGELOG-Latest-green)](https://rubydoc.info/gems/process_executer/file/CHANGELOG.md)
6
6
  [![Build Status](https://github.com/main-branch/process_executer/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/main-branch/process_executer/actions/workflows/continuous-integration.yml)
7
- [![Maintainability](https://api.codeclimate.com/v1/badges/0b5c67e5c2a773009cd0/maintainability)](https://codeclimate.com/github/main-branch/process_executer/maintainability)
8
- [![Test Coverage](https://api.codeclimate.com/v1/badges/0b5c67e5c2a773009cd0/test_coverage)](https://codeclimate.com/github/main-branch/process_executer/test_coverage)
9
7
  [![Conventional
10
8
  Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
11
9
  [![Slack](https://img.shields.io/badge/slack-main--branch/process__executer-yellow.svg?logo=slack)](https://main-branch.slack.com/archives/C07NG2BPG8Y)
data/Rakefile CHANGED
@@ -28,6 +28,13 @@ rescue Bundler::BundlerError => e
28
28
  exit e.status_code
29
29
  end
30
30
 
31
+ # Make it so that calling `rake release` just calls `rake release:rubygems_push` to
32
+ # avoid creating and pushing a new tag.
33
+
34
+ Rake::Task['release'].clear
35
+ desc 'Customized release task to avoid creating a new tag'
36
+ task release: 'release:rubygem_push'
37
+
31
38
  CLEAN << 'pkg'
32
39
  CLOBBER << 'Gemfile.lock'
33
40
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'stringio'
4
4
  require 'io/wait'
5
+ require 'track_open_instances'
5
6
 
6
7
  module ProcessExecuter
7
8
  # Write data sent through a pipe to a destination
@@ -41,6 +42,8 @@ module ProcessExecuter
41
42
  # @api public
42
43
  #
43
44
  class MonitoredPipe
45
+ include TrackOpenInstances
46
+
44
47
  # Create a new monitored pipe
45
48
  #
46
49
  # Creates a IO.pipe and starts a monitoring thread to read data written to the pipe.
@@ -64,6 +67,8 @@ module ProcessExecuter
64
67
  @pipe_reader, @pipe_writer = IO.pipe
65
68
  @state = :open
66
69
  @thread = start_monitoring_thread
70
+
71
+ self.class.add_open_instance(self)
67
72
  end
68
73
 
69
74
  # Set the state to `:closing` and wait for the state to be set to `:closed`
@@ -83,18 +88,15 @@ module ProcessExecuter
83
88
  #
84
89
  def close
85
90
  mutex.synchronize do
86
- return unless state == :open
87
-
88
- @state = :closing
89
- end
90
-
91
- mutex.synchronize do
92
- condition_variable.wait(mutex) while @state != :closed
91
+ if state == :open
92
+ @state = :closing
93
+ condition_variable.wait(mutex) while @state != :closed
94
+ end
93
95
  end
94
96
 
95
97
  thread.join
96
-
97
98
  destination.close
99
+ self.class.remove_open_instance(self)
98
100
  end
99
101
 
100
102
  # Return the write end of the pipe so that data can be written to it
@@ -52,7 +52,8 @@ module ProcessExecuter
52
52
  opened_pipes = wrap_stdout_stderr(options)
53
53
  ProcessExecuter.spawn_and_wait_with_options(command, options)
54
54
  ensure
55
- opened_pipes.each { |key, value| close_pipe(command, key, value) }
55
+ opened_pipes.each_value(&:close)
56
+ opened_pipes.each { |option_key, pipe| raise_pipe_error(command, option_key, pipe) }
56
57
  end
57
58
 
58
59
  # Wrap the stdout and stderr redirection options with a MonitoredPipe
@@ -81,16 +82,6 @@ module ProcessExecuter
81
82
  ProcessExecuter::Destinations.compatible_with_monitored_pipe?(value)
82
83
  end
83
84
 
84
- # Close the pipe and raise an error if the pipe raised an exception
85
- # @return [void]
86
- # @raise [ProcessExecuter::ProcessIOError] If an exception was raised while
87
- # collecting subprocess output
88
- # @api private
89
- def close_pipe(command, option_key, pipe)
90
- pipe.close
91
- raise_pipe_error(command, option_key, pipe) if pipe.exception
92
- end
93
-
94
85
  # Process the result of the command and return a ProcessExecuter::Result
95
86
  #
96
87
  # Log the command and result, and raise an error if the command failed.
@@ -144,6 +135,8 @@ module ProcessExecuter
144
135
  # @api private
145
136
  #
146
137
  def raise_pipe_error(command, option_key, pipe)
138
+ return unless pipe.exception
139
+
147
140
  error = ProcessExecuter::ProcessIOError.new("Pipe Exception for #{command}: #{option_key.inspect}")
148
141
  raise(error, cause: pipe.exception)
149
142
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module ProcessExecuter
4
4
  # The current Gem version
5
- VERSION = '3.2.0'
5
+ VERSION = '3.2.3'
6
6
  end
@@ -37,6 +37,8 @@ Gem::Specification.new do |spec|
37
37
  'Ruby: MRI 3.1 or later, TruffleRuby 24 or later, or JRuby 9.4 or later'
38
38
  ]
39
39
 
40
+ spec.add_dependency 'track_open_instances', '~> 0.1'
41
+
40
42
  spec.add_development_dependency 'bundler-audit', '~> 0.9'
41
43
  spec.add_development_dependency 'create_github_release', '~> 2.1'
42
44
  spec.add_development_dependency 'main_branch_shared_rubocop_config', '~> 0.1'
@@ -0,0 +1,22 @@
1
+ {
2
+ "bootstrap-sha": "d12757fe8f44f5cf2bb9092c686d642fe41f436f",
3
+ "packages": {
4
+ ".": {
5
+ "release-type": "ruby",
6
+ "package-name": "process_executer",
7
+ "changelog-path": "CHANGELOG.md",
8
+ "version-file": "lib/process_executer/version.rb",
9
+ "bump-minor-pre-major": true,
10
+ "bump-patch-for-minor-pre-major": true,
11
+ "draft": false,
12
+ "prerelease": false,
13
+ "include-component-in-tag": false
14
+ }
15
+ },
16
+ "plugins": [
17
+ {
18
+ "type": "sentence-case"
19
+ }
20
+ ],
21
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
22
+ }
metadata CHANGED
@@ -1,14 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: process_executer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Couball
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-05 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: track_open_instances
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '0.1'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '0.1'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: bundler-audit
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -207,6 +221,7 @@ files:
207
221
  - ".commitlintrc.yml"
208
222
  - ".husky/commit-msg"
209
223
  - ".markdownlint.yml"
224
+ - ".release-please-manifest.json"
210
225
  - ".rspec"
211
226
  - ".rubocop.yml"
212
227
  - ".yardopts"
@@ -243,6 +258,7 @@ files:
243
258
  - lib/process_executer/version.rb
244
259
  - package.json
245
260
  - process_executer.gemspec
261
+ - release-please-config.json
246
262
  homepage: https://github.com/main-branch/process_executer
247
263
  licenses:
248
264
  - MIT
@@ -250,8 +266,8 @@ metadata:
250
266
  allowed_push_host: https://rubygems.org
251
267
  homepage_uri: https://github.com/main-branch/process_executer
252
268
  source_code_uri: https://github.com/main-branch/process_executer
253
- documentation_uri: https://rubydoc.info/gems/process_executer/3.2.0
254
- changelog_uri: https://rubydoc.info/gems/process_executer/3.2.0/file/CHANGELOG.md
269
+ documentation_uri: https://rubydoc.info/gems/process_executer/3.2.3
270
+ changelog_uri: https://rubydoc.info/gems/process_executer/3.2.3/file/CHANGELOG.md
255
271
  rubygems_mfa_required: 'true'
256
272
  rdoc_options: []
257
273
  require_paths:
@@ -269,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
269
285
  requirements:
270
286
  - 'Platform: Mac, Linux, or Windows'
271
287
  - 'Ruby: MRI 3.1 or later, TruffleRuby 24 or later, or JRuby 9.4 or later'
272
- rubygems_version: 3.6.2
288
+ rubygems_version: 3.6.7
273
289
  specification_version: 4
274
290
  summary: An API for executing commands in a subprocess
275
291
  test_files: []