pstree 0.5.0 → 0.7.0
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/CHANGES.md +28 -0
- data/Gemfile +0 -2
- data/Rakefile +5 -2
- data/VERSION +1 -1
- data/lib/pstree/version.rb +7 -2
- data/lib/pstree.rb +11 -2
- data/pstree.gemspec +4 -4
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 65ab9fa8a5e50837215ab148d3b694b676798431297d3a80261a411e3eca5bf4
|
|
4
|
+
data.tar.gz: db76c795d19390c347b2539c1a49fd698d8e7cbb93a16508abb1d0bb8e6c5d30
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 591c9e8e4d468e4b02cc90f455a901e201f7adddc473ce4448bf07f692115fdb55897af4ad988c389e2c35feb75a6016d676b3facfdee13038b0ae658c43741f
|
|
7
|
+
data.tar.gz: 7719796b7e0c0d45ce8869633e9dbbea99bd571dc7dfff7d78e1dfcec7084438f0379da638be902a7a831e873dbf89922bb6837827367c99cfbf5069fa859ec8
|
data/CHANGES.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-11-19 v0.7.0
|
|
4
|
+
|
|
5
|
+
### Improvements
|
|
6
|
+
|
|
7
|
+
- Widen process ID padding in `PSTree` output from 5 to 7 characters in the
|
|
8
|
+
`to_s` method.
|
|
9
|
+
|
|
10
|
+
### Build & CI
|
|
11
|
+
|
|
12
|
+
- Bump `gem_hadar` development dependency floor to `>= 2.24.1`.
|
|
13
|
+
- Remove stale vim modelines from `Gemfile` and `Rakefile`.
|
|
14
|
+
- Change `Rakefile` file mode from 755 to 644.
|
|
15
|
+
- Regenerate `lib/pstree/version.rb` with the current GemHadar comment
|
|
16
|
+
template.
|
|
17
|
+
|
|
18
|
+
## 2026-01-02 v0.6.0
|
|
19
|
+
|
|
20
|
+
- Added caching mechanism for `/bin/ps` command output using the `psoutput`
|
|
21
|
+
method with `@psoutput ||= ...` memoization pattern
|
|
22
|
+
- Maintained backward compatibility while improving performance by avoiding
|
|
23
|
+
repeated system calls
|
|
24
|
+
- Introduced automated changelog generation configuration in the Rakefile with
|
|
25
|
+
`changelog` block setting `filename` to `'CHANGES.md'`
|
|
26
|
+
- Updated gem dependencies including `rubygems_version` from **3.6.9** to
|
|
27
|
+
**4.0.2** and `gem_hadar` development dependency from **~> 2.1** to **>=
|
|
28
|
+
2.16.3**
|
|
29
|
+
- Enabled proper changelog handling during gem packaging and release workflows
|
|
30
|
+
|
|
3
31
|
## 2025-08-19 v0.5.0
|
|
4
32
|
|
|
5
33
|
- **Documentation**: Comprehensive YARD documentation added to all classes and
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# vim: set filetype=ruby et sw=2 ts=2:
|
|
2
|
-
|
|
3
1
|
require 'gem_hadar'
|
|
4
2
|
|
|
5
3
|
GemHadar do
|
|
@@ -12,6 +10,11 @@ GemHadar do
|
|
|
12
10
|
summary 'Ruby library that builds a process tree of this host'
|
|
13
11
|
description 'This library uses the output of the ps command to creaste process tree data structure for the current host.'
|
|
14
12
|
licenses << 'GPL-2'
|
|
13
|
+
|
|
14
|
+
changelog do
|
|
15
|
+
filename 'CHANGES.md'
|
|
16
|
+
end
|
|
17
|
+
|
|
15
18
|
test_dir 'tests'
|
|
16
19
|
ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.rvmrc', 'coverage',
|
|
17
20
|
'.yardoc', 'doc'
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.7.0
|
data/lib/pstree/version.rb
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
# Version information for the PSTree gem.
|
|
2
|
+
#
|
|
3
|
+
# This class is auto-generated by GemHadar and exposes the
|
|
4
|
+
# current release version as a set of constants. Do not edit it
|
|
5
|
+
# by hand; it is rewritten on every `rake version` invocation.
|
|
1
6
|
class PSTree
|
|
2
|
-
# PSTree
|
|
3
|
-
VERSION = '0.
|
|
7
|
+
# The current version of the PSTree gem as a String.
|
|
8
|
+
VERSION = '0.7.0'
|
|
4
9
|
VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
|
|
5
10
|
VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
|
|
6
11
|
VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
|
data/lib/pstree.rb
CHANGED
|
@@ -64,7 +64,7 @@ class PSTree
|
|
|
64
64
|
# @return [ String ] a formatted string containing the process ID, command,
|
|
65
65
|
# and user separated by spaces and parentheses
|
|
66
66
|
def to_s
|
|
67
|
-
"%
|
|
67
|
+
"%07u %s (%s)" % [ pid, cmd, user ]
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
|
@@ -165,7 +165,6 @@ class PSTree
|
|
|
165
165
|
@child_count = [ 0 ]
|
|
166
166
|
@process = {}
|
|
167
167
|
@pstree = Hash.new { |h,k| h[k] = [] }
|
|
168
|
-
psoutput = `/bin/ps axww -o ppid,pid,user,command`
|
|
169
168
|
psoutput.each_line do |line|
|
|
170
169
|
next if line !~ /^\s*\d+/
|
|
171
170
|
line.strip!
|
|
@@ -175,6 +174,16 @@ class PSTree
|
|
|
175
174
|
end
|
|
176
175
|
end
|
|
177
176
|
|
|
177
|
+
# The psoutput method executes the ps command to retrieve process information
|
|
178
|
+
# and caches the result for subsequent calls
|
|
179
|
+
#
|
|
180
|
+
# @return [ String ] the raw output from the ps command containing process
|
|
181
|
+
# information including parent process ID, process ID, user,
|
|
182
|
+
# and command line for all running processes
|
|
183
|
+
def psoutput
|
|
184
|
+
@psoutput ||= `/bin/ps axww -o ppid,pid,user,command`
|
|
185
|
+
end
|
|
186
|
+
|
|
178
187
|
# The recurse method performs a recursive traversal of the process tree
|
|
179
188
|
# starting from a given process ID.
|
|
180
189
|
#
|
data/pstree.gemspec
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: pstree 0.
|
|
2
|
+
# stub: pstree 0.7.0 ruby lib
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "pstree".freeze
|
|
6
|
-
s.version = "0.
|
|
6
|
+
s.version = "0.7.0".freeze
|
|
7
7
|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
|
9
9
|
s.require_paths = ["lib".freeze]
|
|
@@ -17,10 +17,10 @@ Gem::Specification.new do |s|
|
|
|
17
17
|
s.homepage = "https://github.com/flori/pstree".freeze
|
|
18
18
|
s.licenses = ["GPL-2".freeze]
|
|
19
19
|
s.rdoc_options = ["--title".freeze, "Pstree - Ruby library that builds a process tree of this host".freeze, "--main".freeze, "README.md".freeze]
|
|
20
|
-
s.rubygems_version = "
|
|
20
|
+
s.rubygems_version = "4.0.24".freeze
|
|
21
21
|
s.summary = "Ruby library that builds a process tree of this host".freeze
|
|
22
22
|
|
|
23
23
|
s.specification_version = 4
|
|
24
24
|
|
|
25
|
-
s.add_development_dependency(%q<gem_hadar>.freeze, ["
|
|
25
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.24.1".freeze])
|
|
26
26
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pstree
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Frank
|
|
@@ -13,16 +13,16 @@ dependencies:
|
|
|
13
13
|
name: gem_hadar
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
|
-
- - "
|
|
16
|
+
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 2.24.1
|
|
19
19
|
type: :development
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
|
-
- - "
|
|
23
|
+
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
25
|
+
version: 2.24.1
|
|
26
26
|
description: This library uses the output of the ps command to creaste process tree
|
|
27
27
|
data structure for the current host.
|
|
28
28
|
email: flori@ping.de
|
|
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
69
|
requirements: []
|
|
70
|
-
rubygems_version:
|
|
70
|
+
rubygems_version: 4.0.24
|
|
71
71
|
specification_version: 4
|
|
72
72
|
summary: Ruby library that builds a process tree of this host
|
|
73
73
|
test_files: []
|