rb-process 0.1.0 → 0.1.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: fb024feedecacd42742fcfbd1d030fee5466b25ae1e8dc28aa07a05ff8a92fcf
4
- data.tar.gz: c1b62cdc11fce5cc67280683240fba904111f3cd0a774a20783c5ddc7a882aa3
3
+ metadata.gz: d1ffa4069fc9c706b434d6a4729f9feaa9f7a698253e15b10bb1be3b38a3621b
4
+ data.tar.gz: 31ace92e9ed794539a4be81b2bdcd264045189428efe892dbee1e08f786c3f9e
5
5
  SHA512:
6
- metadata.gz: 405d0014ff27b89ac5d223ce3bbbd2006bb2bef70d1f5dad4284c2e9eb7d6ec49058e1a016e6b8a8a2ad19f69fc5aca012873cc71d1d5fb9473007e832db99c0
7
- data.tar.gz: 7c063f3fd904ef415b72bf2be14213f3665f80e63e2bd6dc106e2390f08361789cd52f32cfe3bdcda207136f9d1f4562f5e0edcc3751735a6f279468601848d2
6
+ metadata.gz: a98ad3a144425b94b9a4a16bb4be1f66b1762dfe40aa872577392f58f32968f9a12fd08efb68320b8d0126e8b57ef23330252f1822d375d67c3795e64e242a55
7
+ data.tar.gz: 9cf46ca2a81b9b128d497742f855bb9fbf8685e3718d27d0803207e79c8d0040f13b96880a60b6b9170f7df18dc54e7c2c76523042e13554c1aa26ec8abac8ee
data/.rubocop.yml CHANGED
@@ -3,3 +3,12 @@ inherit_gem:
3
3
 
4
4
  Metrics/MethodLength:
5
5
  Enabled: false
6
+
7
+ Metrics/BlockLength:
8
+ Enabled: false
9
+
10
+ Metrics/AbcSize:
11
+ Enabled: false
12
+
13
+ Style/ConditionalAssignment:
14
+ Enabled: false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Process
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/rb/process.rb CHANGED
@@ -1,10 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "multi_io"
3
4
  require_relative "process/version"
4
5
 
5
6
  module Process
6
- def self.run(*args, **options)
7
+ def self.run(*args, log_file: nil, **options)
8
+ if log_file && !log_file.is_a?(File)
9
+ raise ArgumentError.new("log_file must be a File with mode")
10
+ end
11
+
12
+ mio = log_file ? MultiIO.new($stdout, log_file) : $stdout
7
13
  result = String.new
14
+
8
15
  IO.popen(*args, **options) do |pipe|
9
16
  if block_given?
10
17
  yield pipe
@@ -12,10 +19,12 @@ module Process
12
19
  end
13
20
  while !pipe.eof
14
21
  line = pipe.gets
15
- print line
22
+ mio.write(line)
16
23
  result << line
17
24
  end
18
25
  end
26
+
27
+ log_file.close if log_file
19
28
  result
20
29
  end
21
30
 
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rb-process
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - initdc
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 2025-11-04 00:00:00.000000000 Z
11
+ date: 2026-02-17 00:00:00.000000000 Z
11
12
  dependencies: []
12
13
  description: Add the missing methods to the Ruby Process, you can use it with method
13
14
  chaining
@@ -33,6 +34,7 @@ metadata:
33
34
  homepage_uri: https://github.com/initdc/rb-process
34
35
  source_code_uri: https://github.com/initdc/rb-process.git
35
36
  changelog_uri: https://github.com/initdc/rb-process/blob/master/CHANGELOG.md
37
+ post_install_message:
36
38
  rdoc_options: []
37
39
  require_paths:
38
40
  - lib
@@ -47,7 +49,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
49
  - !ruby/object:Gem::Version
48
50
  version: '0'
49
51
  requirements: []
50
- rubygems_version: 3.6.2
52
+ rubygems_version: 3.5.22
53
+ signing_key:
51
54
  specification_version: 4
52
55
  summary: Add the missing methods to the Ruby Process, you can use it with method chaining
53
56
  test_files: []