hamster-the-process-watcher 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/hamster-the-process-watcher.gemspec +2 -2
- data/lib/process_watch.rb +12 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.1
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{hamster-the-process-watcher}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Curtis Schofield"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-08-16}
|
13
13
|
s.description = %q{Dedicated to hamsters running in wheels everywhere}
|
14
14
|
s.email = %q{github.com@robotarmyma.de}
|
15
15
|
s.executables = ["test_daemon", "hamster"]
|
data/lib/process_watch.rb
CHANGED
@@ -5,7 +5,14 @@ class ProcessWatch
|
|
5
5
|
:command,
|
6
6
|
:callback,
|
7
7
|
:callback_message
|
8
|
-
|
8
|
+
#
|
9
|
+
# #
|
10
|
+
# # example : run test_daemon - test_daemon runs forever
|
11
|
+
# #
|
12
|
+
# # don't forget to kill the test_daemon pid when you are done playing.
|
13
|
+
# #
|
14
|
+
# $ hamster --watch 'test_daemon ID=1' --command "test_daemon ID=1"
|
15
|
+
#
|
9
16
|
def initialize(options)
|
10
17
|
self.command = options[:command] || nil
|
11
18
|
self.callback = options[:callback] ||
|
@@ -19,7 +26,10 @@ class ProcessWatch
|
|
19
26
|
end
|
20
27
|
|
21
28
|
class << self
|
22
|
-
|
29
|
+
|
30
|
+
#
|
31
|
+
# -xf => my proccesses => $1 is parent pid of watch_string match
|
32
|
+
# -x => my processes => $1 is pid of of watch_string match
|
23
33
|
def find(watch_string,ps_args = "")
|
24
34
|
cmd = %%ps -x#{ps_args} |grep '#{watch_string}' |grep -v grep | grep -v 'watch #{watch_string}' | awk '{print $1}'%
|
25
35
|
pids = %x{#{cmd}}.split()
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamster-the-process-watcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 1
|
10
|
+
version: 1.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Curtis Schofield
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-08-16 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|