pstree 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/pstree.rb +20 -3
- data/lib/pstree/version.rb +1 -1
- data/pstree.gemspec +23 -23
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e014bdaf62c7729a110d61a4a6e843203794f63d
|
4
|
+
data.tar.gz: 82a952887e613b3e207156254eca617cca7f1530
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecb0e4c7184909e8f01242a766fa568ef4e7ee3d501ce092aab890a0f25eb5a9512392e11ea368ae0222c2d8f2ea233d30c2fce7d320e6748036ce2c4d7bb48f
|
7
|
+
data.tar.gz: 27c9c88f99d4451ac72b4f8e6fc6f4406e8551bab0925b8b650b9972c0ab58817eab1ad82f80575faa08db8b69260ebd0d5570ecf9f8a5d634c7746ed4cd1bd3
|
data/.gitignore
CHANGED
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ GemHadar do
|
|
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
15
|
test_dir 'tests'
|
16
|
-
ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.rvmrc', 'coverage'
|
16
|
+
ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.rvmrc', 'coverage'
|
17
17
|
readme 'README.rdoc'
|
18
18
|
executables << 'ruby-pstree'
|
19
19
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/lib/pstree.rb
CHANGED
@@ -15,19 +15,36 @@ class PSTree
|
|
15
15
|
|
16
16
|
include Enumerable
|
17
17
|
|
18
|
-
def initialize(root_pid = nil)
|
18
|
+
def initialize(root_pid = nil, charset: 'UTF-8')
|
19
|
+
@charset = charset.to_s.upcase
|
19
20
|
@root_pid = root_pid.to_i
|
20
21
|
end
|
21
22
|
|
23
|
+
def children_zero(last)
|
24
|
+
if @charset == 'UTF-8'
|
25
|
+
last ? '└─ ' : ' '
|
26
|
+
else
|
27
|
+
last ? '`- ' : ' '
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def children_not_zero(last)
|
32
|
+
if @charset == 'UTF-8'
|
33
|
+
last ? '├─ ' : '│ '
|
34
|
+
else
|
35
|
+
last ? '+- ' : '| '
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
22
39
|
def to_s
|
23
40
|
build
|
24
41
|
result = ''
|
25
42
|
recurse @root_pid,
|
26
43
|
-> children, last {
|
27
44
|
if children.zero?
|
28
|
-
result << (last
|
45
|
+
result << children_zero(last)
|
29
46
|
else
|
30
|
-
result << (last
|
47
|
+
result << children_not_zero(last)
|
31
48
|
end
|
32
49
|
} do |ps|
|
33
50
|
result << ps.to_s << "\n"
|
data/lib/pstree/version.rb
CHANGED
data/pstree.gemspec
CHANGED
@@ -1,37 +1,37 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: pstree 0.
|
2
|
+
# stub: pstree 0.2.0 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
|
-
s.name = "pstree"
|
6
|
-
s.version = "0.
|
5
|
+
s.name = "pstree".freeze
|
6
|
+
s.version = "0.2.0"
|
7
7
|
|
8
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
|
-
s.require_paths = ["lib"]
|
10
|
-
s.authors = ["Florian Frank"]
|
11
|
-
s.date = "
|
12
|
-
s.description = "This library uses the output of the ps command to creaste process tree data structure for the current host."
|
13
|
-
s.email = "flori@ping.de"
|
14
|
-
s.executables = ["ruby-pstree"]
|
15
|
-
s.extra_rdoc_files = ["README.rdoc", "lib/pstree.rb", "lib/pstree/version.rb"]
|
16
|
-
s.files = [".gitignore", "Gemfile", "README.rdoc", "Rakefile", "VERSION", "bin/ruby-pstree", "lib/pstree.rb", "lib/pstree/version.rb", "pstree.gemspec"]
|
17
|
-
s.homepage = "http://flori.github.com/pstree"
|
18
|
-
s.licenses = ["GPL-2"]
|
19
|
-
s.rdoc_options = ["--title", "Pstree - Ruby library that builds a process tree of this host", "--main", "README.rdoc"]
|
20
|
-
s.rubygems_version = "2.
|
21
|
-
s.summary = "Ruby library that builds a process tree of this host"
|
8
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
|
+
s.require_paths = ["lib".freeze]
|
10
|
+
s.authors = ["Florian Frank".freeze]
|
11
|
+
s.date = "2017-11-07"
|
12
|
+
s.description = "This library uses the output of the ps command to creaste process tree data structure for the current host.".freeze
|
13
|
+
s.email = "flori@ping.de".freeze
|
14
|
+
s.executables = ["ruby-pstree".freeze]
|
15
|
+
s.extra_rdoc_files = ["README.rdoc".freeze, "lib/pstree.rb".freeze, "lib/pstree/version.rb".freeze]
|
16
|
+
s.files = [".gitignore".freeze, "Gemfile".freeze, "README.rdoc".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/ruby-pstree".freeze, "lib/pstree.rb".freeze, "lib/pstree/version.rb".freeze, "pstree.gemspec".freeze]
|
17
|
+
s.homepage = "http://flori.github.com/pstree".freeze
|
18
|
+
s.licenses = ["GPL-2".freeze]
|
19
|
+
s.rdoc_options = ["--title".freeze, "Pstree - Ruby library that builds a process tree of this host".freeze, "--main".freeze, "README.rdoc".freeze]
|
20
|
+
s.rubygems_version = "2.6.13".freeze
|
21
|
+
s.summary = "Ruby library that builds a process tree of this host".freeze
|
22
22
|
|
23
23
|
if s.respond_to? :specification_version then
|
24
24
|
s.specification_version = 4
|
25
25
|
|
26
26
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
27
|
-
s.add_development_dependency(%q<gem_hadar
|
28
|
-
s.add_development_dependency(%q<simplecov
|
27
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.9.1"])
|
28
|
+
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
29
29
|
else
|
30
|
-
s.add_dependency(%q<gem_hadar
|
31
|
-
s.add_dependency(%q<simplecov
|
30
|
+
s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.9.1"])
|
31
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
32
32
|
end
|
33
33
|
else
|
34
|
-
s.add_dependency(%q<gem_hadar
|
35
|
-
s.add_dependency(%q<simplecov
|
34
|
+
s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.9.1"])
|
35
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
36
36
|
end
|
37
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pstree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.9.1
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.9.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: simplecov
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.
|
85
|
+
rubygems_version: 2.6.13
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Ruby library that builds a process tree of this host
|