win32-process 0.8.3 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +74 -0
- data/lib/win32-process.rb +1 -1
- data/lib/win32/process.rb +1139 -1141
- data/lib/win32/process/constants.rb +121 -121
- data/lib/win32/process/functions.rb +91 -91
- data/lib/win32/process/helper.rb +12 -12
- data/lib/win32/process/structs.rb +218 -218
- data/test/test_win32_process.rb +370 -370
- data/test/test_win32_process_kill.rb +143 -165
- data/win32-process.gemspec +23 -29
- metadata +11 -76
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +0 -270
- data/MANIFEST +0 -15
- data/README +0 -78
- data/Rakefile +0 -60
- data/certs/djberg96_pub.pem +0 -21
- data/examples/example_create.rb +0 -35
- data/examples/example_kill.rb +0 -34
- metadata.gz.sig +0 -2
data/examples/example_create.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
##########################################################################
|
2
|
-
# example_create.rb
|
3
|
-
#
|
4
|
-
# Simple test program for the Process.create() method. You can run this
|
5
|
-
# code via the 'example:create' task.
|
6
|
-
##########################################################################
|
7
|
-
require "win32/process"
|
8
|
-
|
9
|
-
p Process::WIN32_PROCESS_VERSION
|
10
|
-
|
11
|
-
struct = Process.create(
|
12
|
-
:app_name => "notepad.exe",
|
13
|
-
:creation_flags => Process::DETACHED_PROCESS,
|
14
|
-
:process_inherit => false,
|
15
|
-
:thread_inherit => true,
|
16
|
-
:cwd => "C:\\",
|
17
|
-
:inherit => true,
|
18
|
-
:environment => "SYSTEMROOT=#{ENV['SYSTEMROOT']};PATH=C:\\"
|
19
|
-
)
|
20
|
-
|
21
|
-
p struct
|
22
|
-
|
23
|
-
=begin
|
24
|
-
# Don't run this from an existing terminal
|
25
|
-
pid = Process.create(
|
26
|
-
:app_name => "cmd.exe",
|
27
|
-
:creation_flags => Process::DETACHED_PROCESS,
|
28
|
-
:startf_flags => Process::USEPOSITION,
|
29
|
-
:x => 0,
|
30
|
-
:y => 0,
|
31
|
-
:title => "Hi Dan"
|
32
|
-
)
|
33
|
-
|
34
|
-
puts "Pid of new process: #{pid}"
|
35
|
-
=end
|
data/examples/example_kill.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
##########################################################################
|
2
|
-
# example_kill.rb
|
3
|
-
#
|
4
|
-
# Generic test script for futzing around Process.kill. This script
|
5
|
-
# requires the sys-proctable library.
|
6
|
-
#
|
7
|
-
# You can run this example via the 'example:kill' task.
|
8
|
-
##########################################################################
|
9
|
-
require "win32/process"
|
10
|
-
|
11
|
-
begin
|
12
|
-
require "sys/proctable"
|
13
|
-
rescue LoadError
|
14
|
-
STDERR.puts "Whoa there!"
|
15
|
-
STDERR.puts "This script requires the sys-proctable package to work."
|
16
|
-
STDERR.puts "You can find it at http://ruby-sysutils.sf.net"
|
17
|
-
STDERR.puts "Exiting..."
|
18
|
-
exit
|
19
|
-
end
|
20
|
-
|
21
|
-
include Sys
|
22
|
-
|
23
|
-
puts "VERSION: " + Process::WIN32_PROCESS_VERSION
|
24
|
-
|
25
|
-
IO.popen("notepad")
|
26
|
-
sleep 1 # Give it a chance to start before checking for its pid
|
27
|
-
|
28
|
-
pids = []
|
29
|
-
|
30
|
-
ProcTable.ps{ |s|
|
31
|
-
pids.push(s.pid) if s.cmdline =~ /notepad/i
|
32
|
-
}
|
33
|
-
|
34
|
-
p Process.kill(9,pids.last)
|
metadata.gz.sig
DELETED