zerg_support 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.1.1. Switched from rssize to rss in 'ps' for Snow Leopard. Removed warnings.
2
+
1
3
  v0.1. Socket primitives.
2
4
 
3
5
  v0.0.9. Changed ProcTable wrapper to deal with API change in 0.8.0.
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ Echoe.new('zerg_support') do |p|
8
8
  p.author = 'Victor Costan'
9
9
  p.email = 'victor@zergling.net'
10
10
  p.summary = 'Support libraries used by Zergling.Net deployment code.'
11
- p.url = 'http://www.zergling.net'
11
+ p.url = 'http://github.com/costan/zerg_support'
12
12
 
13
13
  p.need_tar_gz = !Platform.windows?
14
14
  p.need_zip = !Platform.windows?
@@ -164,14 +164,14 @@ rescue Exception
164
164
  #:nodoc: all
165
165
  module Zerg::Support::ProcTable
166
166
  class ProcInfo
167
- def initialize(pid, ppid, ruid, rgid, uid, gid, start, nice, rss, rssize,
167
+ def initialize(pid, ppid, ruid, rgid, uid, gid, start, nice, rss,
168
168
  text_size, vsz, user_time, total_time, pctcpu, pctmem,
169
169
  priority, user_priority, state, cmdline)
170
170
  @pid, @ppid, @ruid, @rgid, @uid, @gid, @nice, @priority,
171
171
  @user_priority = *([pid, ppid, ruid, rgid, uid, gid, nice,
172
172
  priority, user_priority].map { |s| s.to_i })
173
173
  @start = Time.parse start
174
- @ix_rss, @id_rss, @is_rss = text_size.to_f, rssize.to_f, vsz.to_f
174
+ @ix_rss, @id_rss, @is_rss = text_size.to_f, rss.to_f, vsz.to_f
175
175
  @pctcpu, @pctmem = *([pctcpu, pctmem].map { |s| s.to_f })
176
176
  @cmdline = cmdline
177
177
 
@@ -185,7 +185,7 @@ rescue Exception
185
185
 
186
186
  @@ps_root_cmdline = 'ps -o pid,ppid,ruid,rgid,uid,gid' +
187
187
  ',lstart="STARTED_________________________________"' +
188
- ',nice,rss,rssize,tsiz,vsz,utime,cputime,pcpu="PCPU_"' +
188
+ ',nice,rss,tsiz,vsz,utime,cputime,pcpu="PCPU_"' +
189
189
  ',pmem="PMEM_",pri,usrpri,stat,command'
190
190
 
191
191
  @@ps_all_cmdline = @@ps_root_cmdline + ' -A'
@@ -197,7 +197,7 @@ rescue Exception
197
197
  ps_cmdline = pids.empty? ? @@ps_all_cmdline :
198
198
  @@ps_some_cmdline + pids.join(',')
199
199
  ps_output = Kernel.` ps_cmdline
200
- header_splits = nil
200
+ header_splits = nil
201
201
  ps_output.each_line do |pline|
202
202
  if header_splits
203
203
  # result line, break it up
@@ -6,6 +6,7 @@ module FrameProtocol
6
6
  # Called when data is available from the TCP stream.
7
7
  def received_bytes(data)
8
8
  @frame_protocol_varsize ||= ''
9
+ @frame_protocol_buffer = nil unless defined?(@frame_protocol_buffer)
9
10
 
10
11
  i = 0
11
12
  loop do
@@ -82,7 +82,7 @@ else
82
82
  # ruby1.9+: spawn!
83
83
  options = options.dup
84
84
  env = options.delete(:env)
85
- Kernel.spawn *([env, binary] + args + [options])
85
+ Kernel.spawn(*([env, binary] + args + [options]))
86
86
  else
87
87
  # below 1.9: emulate
88
88
 
@@ -96,7 +96,7 @@ else
96
96
  Helpers.set_environment options
97
97
  Helpers.set_rlimits options
98
98
 
99
- Kernel.exec *([binary] + args)
99
+ Kernel.exec(*([binary] + args))
100
100
  end
101
101
  end
102
102
 
@@ -10,7 +10,9 @@ class TestProcess < Test::Unit::TestCase
10
10
  end
11
11
 
12
12
  def teardown
13
- @pid_files.each { |f| File.delete f rescue nil } if @pid_files
13
+ if defined?(@pid_files)
14
+ @pid_files.each { |f| File.delete f rescue nil }
15
+ end
14
16
  super
15
17
  end
16
18
 
@@ -2,20 +2,20 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{zerg_support}
5
- s.version = "0.1"
5
+ s.version = "0.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Victor Costan"]
9
- s.date = %q{2009-06-02}
9
+ s.date = %q{2009-08-19}
10
10
  s.description = %q{Support libraries used by Zergling.Net deployment code.}
11
11
  s.email = %q{victor@zergling.net}
12
12
  s.extra_rdoc_files = ["CHANGELOG", "lib/zerg_support/event_machine/connection_mocks.rb", "lib/zerg_support/event_machine/protocol_adapter.rb", "lib/zerg_support/gems.rb", "lib/zerg_support/open_ssh.rb", "lib/zerg_support/process.rb", "lib/zerg_support/protocols/frame_protocol.rb", "lib/zerg_support/protocols/object_protocol.rb", "lib/zerg_support/socket_factory.rb", "lib/zerg_support/sockets/protocol_adapter.rb", "lib/zerg_support/sockets/socket_mocks.rb", "lib/zerg_support/spawn.rb", "lib/zerg_support.rb", "LICENSE", "README"]
13
13
  s.files = ["CHANGELOG", "lib/zerg_support/event_machine/connection_mocks.rb", "lib/zerg_support/event_machine/protocol_adapter.rb", "lib/zerg_support/gems.rb", "lib/zerg_support/open_ssh.rb", "lib/zerg_support/process.rb", "lib/zerg_support/protocols/frame_protocol.rb", "lib/zerg_support/protocols/object_protocol.rb", "lib/zerg_support/socket_factory.rb", "lib/zerg_support/sockets/protocol_adapter.rb", "lib/zerg_support/sockets/socket_mocks.rb", "lib/zerg_support/spawn.rb", "lib/zerg_support.rb", "LICENSE", "Manifest", "Rakefile", "README", "RUBYFORGE", "test/fork_tree.rb", "test/test_connection_mocks.rb", "test/test_frame_protocol.rb", "test/test_gems.rb", "test/test_object_protocol.rb", "test/test_open_ssh.rb", "test/test_process.rb", "test/test_socket_factory.rb", "test/test_spawn.rb", "zerg_support.gemspec"]
14
- s.homepage = %q{http://www.zergling.net}
14
+ s.homepage = %q{http://github.com/costan/zerg_support}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Zerg_support", "--main", "README"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = %q{zerglings}
18
- s.rubygems_version = %q{1.3.4}
18
+ s.rubygems_version = %q{1.3.5}
19
19
  s.summary = %q{Support libraries used by Zergling.Net deployment code.}
20
20
  s.test_files = ["test/test_connection_mocks.rb", "test/test_frame_protocol.rb", "test/test_gems.rb", "test/test_object_protocol.rb", "test/test_open_ssh.rb", "test/test_process.rb", "test/test_socket_factory.rb", "test/test_spawn.rb"]
21
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zerg_support
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
  - Victor Costan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-02 00:00:00 -04:00
12
+ date: 2009-08-19 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -94,7 +94,7 @@ files:
94
94
  - test/test_spawn.rb
95
95
  - zerg_support.gemspec
96
96
  has_rdoc: true
97
- homepage: http://www.zergling.net
97
+ homepage: http://github.com/costan/zerg_support
98
98
  licenses: []
99
99
 
100
100
  post_install_message:
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements: []
123
123
 
124
124
  rubyforge_project: zerglings
125
- rubygems_version: 1.3.4
125
+ rubygems_version: 1.3.5
126
126
  signing_key:
127
127
  specification_version: 3
128
128
  summary: Support libraries used by Zergling.Net deployment code.