pstree 0.5.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47afd4e4734bfc1207cc7ac432880efd4a15689bf2cf9b25f50ab3583a748e98
4
- data.tar.gz: 4825f7854d8e02ac38451804209ddc6c61378c5c35d3139700fa8b1bbd30d49c
3
+ metadata.gz: 62bc08271e7bb6e098322248dfbe0e7ac1c7a044bf7802c4863a29c72fb6a8dd
4
+ data.tar.gz: e3fef7f619bafe0175245538f1851b2019c079d80f4e21720f769ed34e366ad6
5
5
  SHA512:
6
- metadata.gz: 65425a386c1966d95f70137c3eca9d59d9d2f48b944e23bcea44072de7639b12d137700d708bd13c24be0c111b9b3305c4d09ac0243d2e308b02e69f97e69760
7
- data.tar.gz: 21b6b6df89ed649cea68509e8c2e96d87fdcf81f4d5d5f6ae9cb28d4a45165a1acab3ce09c6a79f916a8e08d9ded5c3582742afb2107d2b6b1d51cb18cb7b3e0
6
+ metadata.gz: 7e493bb3a0ec7332a293db54c89b109766e5741c9292cda2c11952b8f474976e8bfe9e2907aff8000e269af5e39c7346f38f397d4d549e39d80b0b6a8444391e
7
+ data.tar.gz: 891a5c43c58b2e67818e286af85c6d19c9e9c5d1f2367883d6719166ea123c7bfcf64e9866356c6a1f48f0acf51cbd676a684c57121860b1d83cbad439be67e9
data/CHANGES.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-01-02 v0.6.0
4
+
5
+ - Added caching mechanism for `/bin/ps` command output using the `psoutput`
6
+ method with `@psoutput ||= ...` memoization pattern
7
+ - Maintained backward compatibility while improving performance by avoiding
8
+ repeated system calls
9
+ - Introduced automated changelog generation configuration in the Rakefile with
10
+ `changelog` block setting `filename` to `'CHANGES.md'`
11
+ - Updated gem dependencies including `rubygems_version` from **3.6.9** to
12
+ **4.0.2** and `gem_hadar` development dependency from **~> 2.1** to **>=
13
+ 2.16.3**
14
+ - Enabled proper changelog handling during gem packaging and release workflows
15
+
3
16
  ## 2025-08-19 v0.5.0
4
17
 
5
18
  - **Documentation**: Comprehensive YARD documentation added to all classes and
data/Rakefile CHANGED
@@ -12,6 +12,11 @@ GemHadar do
12
12
  summary 'Ruby library that builds a process tree of this host'
13
13
  description 'This library uses the output of the ps command to creaste process tree data structure for the current host.'
14
14
  licenses << 'GPL-2'
15
+
16
+ changelog do
17
+ filename 'CHANGES.md'
18
+ end
19
+
15
20
  test_dir 'tests'
16
21
  ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.rvmrc', 'coverage',
17
22
  '.yardoc', 'doc'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.0
@@ -1,6 +1,6 @@
1
1
  class PSTree
2
2
  # PSTree version
3
- VERSION = '0.5.0'
3
+ VERSION = '0.6.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/lib/pstree.rb CHANGED
@@ -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.5.0 ruby lib
2
+ # stub: pstree 0.6.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "pstree".freeze
6
- s.version = "0.5.0".freeze
6
+ s.version = "0.6.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 = "3.6.9".freeze
20
+ s.rubygems_version = "4.0.2".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, ["~> 2.1".freeze])
25
+ s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.16.3".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.5.0
4
+ version: 0.6.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: '2.1'
18
+ version: 2.16.3
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: '2.1'
25
+ version: 2.16.3
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: 3.6.9
70
+ rubygems_version: 4.0.2
71
71
  specification_version: 4
72
72
  summary: Ruby library that builds a process tree of this host
73
73
  test_files: []