pstree 0.0.0 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6483f4b487ab4ec0b945edb4d9c58123b206ed5
4
- data.tar.gz: e3ee7b02e2f7d05c678633dcf5dc255eb15406f7
3
+ metadata.gz: ad335e8074b06f733803b8ec7cf4be22cd5103dc
4
+ data.tar.gz: d8e8be53530293935cd80346e657af3fbe5ed507
5
5
  SHA512:
6
- metadata.gz: 2cf3d9536175720c6bbc0d7cca86bb63d93f436b452c181cff7705dcc4e346c379e54634cd6c6f8630ec70516b8425eae96d06bd6e0d5e33dc07dc71328e3800
7
- data.tar.gz: bea7fa97a2481d8447e29f719fc3062f099e16f00d1b44b3c4fd3300b73c7ce5783bd87d1f893662661f3d3d59ff49da603f87c236b420c72552651b7848f191
6
+ metadata.gz: 489409a0b6400fea32775ceb01b771acd5bd36b4c41c178ca2aeef1f69beff5b5a67c0172cbf4f09e2b0bb9ad5a36b9cec693ef5159112f43733db80fab1ba15
7
+ data.tar.gz: f72c859c9ded4b1fc787e2a92bf7f4d5f71c5f3c178721a7cab8edee6801a645e08efd7d39693d5f80854ebd06a98ac4b2a583fbf6f8847ee9d68560bb06691e
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  .*.sw[pon]
2
+ .bundle
2
3
  .rvmrc
3
4
  Gemfile.lock
4
5
  coverage
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', '.bundle'
17
17
  readme 'README.rdoc'
18
18
  executables << 'ruby-pstree'
19
19
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.1.0
@@ -52,7 +52,7 @@ class PSTree
52
52
  psoutput.each_line do |line|
53
53
  next if line !~ /^\s*\d+/
54
54
  line.strip!
55
- ps = ProcStruct.new *line.split(/\s+/, 4)
55
+ ps = ProcStruct.new(*line.split(/\s+/, 4))
56
56
  @process[ps.pid] = ps
57
57
  @pstree[ps.ppid] << ps
58
58
  end
@@ -61,13 +61,13 @@ class PSTree
61
61
  def recurse(pid, shift_callback = nil, level = 0, &node_callback)
62
62
  @child_count[level] = @pstree[pid].size
63
63
  for l in 0...level
64
- shift_callback && shift_callback.call(@child_count[l], l == level - 1)
64
+ shift_callback and shift_callback.call(@child_count[l], l == level - 1)
65
65
  end
66
- node_callback && (process = @process[pid]) && node_callback.call(process)
66
+ node_callback and process = @process[pid] and node_callback.call(process)
67
67
  if @pstree.key?(pid)
68
68
  @child_count[level] = @pstree[pid].size - 1
69
69
  @pstree[pid].each do |ps|
70
- recurse(ps.pid, shift_callback, level + 1 , &node_callback)
70
+ recurse(ps.pid, shift_callback, level + 1, &node_callback)
71
71
  @child_count[level] -= 1
72
72
  end
73
73
  end
@@ -1,6 +1,6 @@
1
1
  class PSTree
2
2
  # PSTree version
3
- VERSION = '0.0.0'
3
+ VERSION = '0.1.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:
@@ -1,12 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ # stub: pstree 0.1.0 ruby lib
2
3
 
3
4
  Gem::Specification.new do |s|
4
5
  s.name = "pstree"
5
- s.version = "0.0.0"
6
+ s.version = "0.1.0"
6
7
 
7
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
+ s.require_paths = ["lib"]
8
10
  s.authors = ["Florian Frank"]
9
- s.date = "2013-05-15"
11
+ s.date = "2014-02-06"
10
12
  s.description = "This library uses the output of the ps command to creaste process tree data structure for the current host."
11
13
  s.email = "flori@ping.de"
12
14
  s.executables = ["ruby-pstree"]
@@ -15,22 +17,21 @@ Gem::Specification.new do |s|
15
17
  s.homepage = "http://flori.github.com/pstree"
16
18
  s.licenses = ["GPL-2"]
17
19
  s.rdoc_options = ["--title", "Pstree - Ruby library that builds a process tree of this host", "--main", "README.rdoc"]
18
- s.require_paths = ["lib"]
19
- s.rubygems_version = "2.0.3"
20
+ s.rubygems_version = "2.2.2"
20
21
  s.summary = "Ruby library that builds a process tree of this host"
21
22
 
22
23
  if s.respond_to? :specification_version then
23
24
  s.specification_version = 4
24
25
 
25
26
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
- s.add_development_dependency(%q<gem_hadar>, ["~> 0.3.1"])
27
+ s.add_development_dependency(%q<gem_hadar>, ["~> 1.0.0"])
27
28
  s.add_development_dependency(%q<simplecov>, [">= 0"])
28
29
  else
29
- s.add_dependency(%q<gem_hadar>, ["~> 0.3.1"])
30
+ s.add_dependency(%q<gem_hadar>, ["~> 1.0.0"])
30
31
  s.add_dependency(%q<simplecov>, [">= 0"])
31
32
  end
32
33
  else
33
- s.add_dependency(%q<gem_hadar>, ["~> 0.3.1"])
34
+ s.add_dependency(%q<gem_hadar>, ["~> 1.0.0"])
34
35
  s.add_dependency(%q<simplecov>, [">= 0"])
35
36
  end
36
37
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pstree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.1.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: 2013-05-15 00:00:00.000000000 Z
11
+ date: 2014-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.1
19
+ version: 1.0.0
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: 0.3.1
26
+ version: 1.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: simplecov
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: This library uses the output of the ps command to creaste process tree
@@ -49,7 +49,7 @@ extra_rdoc_files:
49
49
  - lib/pstree.rb
50
50
  - lib/pstree/version.rb
51
51
  files:
52
- - .gitignore
52
+ - ".gitignore"
53
53
  - Gemfile
54
54
  - README.rdoc
55
55
  - Rakefile
@@ -64,25 +64,25 @@ licenses:
64
64
  metadata: {}
65
65
  post_install_message:
66
66
  rdoc_options:
67
- - --title
67
+ - "--title"
68
68
  - Pstree - Ruby library that builds a process tree of this host
69
- - --main
69
+ - "--main"
70
70
  - README.rdoc
71
71
  require_paths:
72
72
  - lib
73
73
  required_ruby_version: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - '>='
75
+ - - ">="
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.0.3
85
+ rubygems_version: 2.2.2
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: Ruby library that builds a process tree of this host