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 +4 -4
- data/.rubocop.yml +9 -0
- data/lib/rb/process/version.rb +1 -1
- data/lib/rb/process.rb +11 -2
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d1ffa4069fc9c706b434d6a4729f9feaa9f7a698253e15b10bb1be3b38a3621b
|
|
4
|
+
data.tar.gz: 31ace92e9ed794539a4be81b2bdcd264045189428efe892dbee1e08f786c3f9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a98ad3a144425b94b9a4a16bb4be1f66b1762dfe40aa872577392f58f32968f9a12fd08efb68320b8d0126e8b57ef23330252f1822d375d67c3795e64e242a55
|
|
7
|
+
data.tar.gz: 9cf46ca2a81b9b128d497742f855bb9fbf8685e3718d27d0803207e79c8d0040f13b96880a60b6b9170f7df18dc54e7c2c76523042e13554c1aa26ec8abac8ee
|
data/.rubocop.yml
CHANGED
data/lib/rb/process/version.rb
CHANGED
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
|
-
|
|
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.
|
|
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:
|
|
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.
|
|
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: []
|