Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support for process names with spaces on Linux #11

Merged
merged 4 commits into from

2 participants

@fabiokung
Collaborator

... and bundler support.

This pull request is an attempt to fix issue #10.

@adamwiggins
Owner

Thanks Fabio. I'm not maintaining rush anymore, would you like to take it over, or at least for me to give you push access to the gem?

@fabiokung
Collaborator

Hey Adam, honestly I'm not sure if I would like to take it over, but if you give me push access and rubyforge credentials I can at least help release a new version.

@fabiokung fabiokung merged commit bf9aac9 into adamwiggins:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
1  .gitignore
@@ -1,2 +1,3 @@
rdoc
pkg
+.rbenv-version
View
3  Gemfile
@@ -0,0 +1,3 @@
+source "http://rubygems.org"
+
+gemspec
View
32 Gemfile.lock
@@ -0,0 +1,32 @@
+PATH
+ remote: .
+ specs:
+ rush (0.6.8)
+ session
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ fattr (2.2.0)
+ git (1.2.5)
+ jeweler (1.8.3)
+ bundler (~> 1.0)
+ git (>= 1.2.5)
+ rake
+ rdoc
+ json (1.6.5)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ rspec (1.2.9)
+ session (3.1.0)
+ fattr
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ jeweler (>= 1.8.3)
+ rake (>= 0.9.0)
+ rspec (~> 1.2.0)
+ rush!
View
2  VERSION
@@ -1 +1 @@
-0.6.6
+0.6.8
View
16 lib/rush/local.rb
@@ -193,16 +193,18 @@ def resolve_unix_uid_to_user(uid)
# Read a single file in /proc and store the parsed values in a hash suitable
# for use in the Rush::Process#new.
def read_proc_file(file)
- data = ::File.read(file).split(" ")
+ stat_contents = ::File.read(file)
+ stat_contents.gsub!(/\((.*)\)/, "")
+ command = $1
+ data = stat_contents.split(" ")
uid = ::File.stat(file).uid
pid = data[0]
- command = data[1].match(/^\((.*)\)$/)[1]
cmdline = ::File.read("/proc/#{pid}/cmdline").gsub(/\0/, ' ')
- parent_pid = data[3].to_i
- utime = data[13].to_i
- ktime = data[14].to_i
- vss = data[22].to_i / 1024
- rss = data[23].to_i * 4
+ parent_pid = data[2].to_i
+ utime = data[12].to_i
+ ktime = data[13].to_i
+ vss = data[21].to_i / 1024
+ rss = data[22].to_i * 4
time = utime + ktime
{
View
6 rush.gemspec
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = %q{rush}
- s.version = "0.6.6"
+ s.version = "0.6.8"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Adam Wiggins"]
@@ -97,6 +97,10 @@ Gem::Specification.new do |s|
"spec/string_ext_spec.rb"
]
+ s.add_development_dependency("rake", [">= 0.9.0"])
+ s.add_development_dependency("jeweler", [">= 1.8.3"])
+ s.add_development_dependency("rspec", ["~> 1.2.0"])
+
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
Something went wrong with that request. Please try again.