after 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +3 -0
- data/VERSION +1 -1
- data/bin/after +16 -6
- data/lib/after.rb +10 -6
- metadata +4 -4
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.2
|
data/bin/after
CHANGED
@@ -1,12 +1,22 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
|
3
3
|
if ARGV.include?('-h') || ARGV.include?('--help') || ARGV.length == 0
|
4
|
-
puts 'syntax: [-q
|
5
|
-
puts '
|
6
|
-
puts '
|
7
|
-
puts "
|
8
|
-
puts "
|
9
|
-
puts
|
4
|
+
puts 'syntax: after [-q] [-l | --list] [-l or --list] [-p pid1 | pid1,pid2,pid3] "command string to match" command to run with args'
|
5
|
+
puts ' -q : quiet mode (don\'t show output for when process ends)'
|
6
|
+
puts ' --list : only list matches, don\'t actually wait for them'
|
7
|
+
puts " \"command string to match\" like ruby.exe or irb : match all processes by name and arguments"
|
8
|
+
puts " command to run with args: some other command to run on completion, like ls -l, no quotes needed."
|
9
|
+
puts
|
10
|
+
puts 'Examples:'
|
11
|
+
puts
|
12
|
+
puts 'after ruby ls -l # run ls -l after all ruby processes exit'
|
13
|
+
puts 'after ruby "ls -l" # same'
|
14
|
+
puts 'after -l # list all running processes'
|
15
|
+
puts 'after -l ruby # list all running processes that have ruby in their executable name or arguments'
|
16
|
+
puts "after irb \"ls | grep l\" # complex command to run after irb terminates (runs $ ls | grep l)"
|
17
|
+
puts "after -p 3704 ls # run ls after process with PID 3704 terminates"
|
18
|
+
puts "after -q -p 3704 ls # run ls after PID 3704 terminates, don't output anything except the output of ls"
|
19
|
+
puts "after -p 3704,4804 ls # run ls after PIDS 3704, 4804 both terminate"
|
10
20
|
exit
|
11
21
|
end
|
12
22
|
|
data/lib/after.rb
CHANGED
@@ -69,12 +69,16 @@ class After
|
|
69
69
|
exit # early exit
|
70
70
|
elsif ARGV[0] == '-p'
|
71
71
|
ARGV.shift
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
72
|
+
pids = ARGV.shift
|
73
|
+
pids = pids.split(',')
|
74
|
+
puts "waiting for pids #{pids.join(',')}" if $VERBOSE and pids.length > 1
|
75
|
+
for pid in pids.split(',')
|
76
|
+
puts "waiting for pid #{pid}" if $VERBOSE
|
77
|
+
begin
|
78
|
+
After.wait_pid pid.to_i
|
79
|
+
rescue Errno::EPERM
|
80
|
+
p 'pid does not exist maybe it already had exited ' + pid if $VERBOSE
|
81
|
+
end
|
78
82
|
end
|
79
83
|
else
|
80
84
|
After.find_and_wait_for(ARGV.shift)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: after
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 59
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 2
|
10
|
+
version: 0.8.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- rogerdpack
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-10-
|
18
|
+
date: 2011-10-05 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: sane
|