win32-event 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +8 -1
- data/MANIFEST +1 -1
- data/Rakefile +1 -3
- data/lib/win32/event.rb +16 -8
- data/test/{tc_event.rb → test_win32_event.rb} +5 -5
- data/win32-event.gemspec +23 -18
- metadata +56 -50
data/CHANGES
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
+
== 0.5.1 - 6-Aug-2009
|
2
|
+
* License changed to Artistic 2.0.
|
3
|
+
* Some gemspec updates, including the addition of a license and an update
|
4
|
+
to the description.
|
5
|
+
* The Event.open method is now slightly more robust.
|
6
|
+
* Renamed the test file to test_win32_event.rb.
|
7
|
+
|
1
8
|
== 0.5.0 - 3-May-2007
|
2
9
|
* Now pure Ruby.
|
3
|
-
* Both the Event.new and Event.
|
10
|
+
* Both the Event.new and Event.open methods now accept a block, and
|
4
11
|
automatically close the associated handle at the end of the block.
|
5
12
|
* The Event.new method now accepts an optional fourth argument that controls
|
6
13
|
whether the Event object can be inherited by other processes.
|
data/MANIFEST
CHANGED
data/Rakefile
CHANGED
data/lib/win32/event.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
require 'win32/ipc'
|
2
2
|
|
3
|
+
# The Win32 module serves as a namespace only.
|
3
4
|
module Win32
|
5
|
+
|
6
|
+
# The Event class encapsulates Windows event objects.
|
4
7
|
class Event < Ipc
|
5
8
|
|
6
9
|
# This is the error raised if any of the Event methods fail.
|
@@ -10,7 +13,8 @@ module Win32
|
|
10
13
|
extend Windows::Error
|
11
14
|
extend Windows::Handle
|
12
15
|
|
13
|
-
|
16
|
+
# The version of the win32-event library
|
17
|
+
VERSION = '0.5.1'
|
14
18
|
|
15
19
|
# The name of the Event object.
|
16
20
|
#
|
@@ -98,9 +102,6 @@ module Win32
|
|
98
102
|
# event doesn't already exist.
|
99
103
|
#
|
100
104
|
# If you want "open or create" semantics, then use Event.new.
|
101
|
-
#--
|
102
|
-
# The OpenEvent() call here is strictly to force an error if the user
|
103
|
-
# tries to open an event that doesn't already exist.
|
104
105
|
#
|
105
106
|
def self.open(name, inherit=true, &block)
|
106
107
|
if name && !name.is_a?(String)
|
@@ -108,11 +109,18 @@ module Win32
|
|
108
109
|
end
|
109
110
|
|
110
111
|
bool = inherit ? 1 : 0
|
111
|
-
|
112
|
-
|
113
|
-
|
112
|
+
|
113
|
+
# This block of code is here strictly to force an error if the user
|
114
|
+
# tries to open an event that doesn't already exist.
|
115
|
+
begin
|
116
|
+
handle = OpenEvent(EVENT_ALL_ACCESS, bool, name)
|
117
|
+
|
118
|
+
if handle == 0 || handle == INVALID_HANDLE_VALUE
|
119
|
+
raise Error, get_last_error
|
120
|
+
end
|
121
|
+
ensure
|
122
|
+
CloseHandle(handle) if handle > 0
|
114
123
|
end
|
115
|
-
CloseHandle(handle)
|
116
124
|
|
117
125
|
self.new(name, false, false, inherit, &block)
|
118
126
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
#####################################################################
|
2
|
-
#
|
2
|
+
# test_win32_event.rb
|
3
3
|
#
|
4
|
-
# Test suite for the win32-event
|
4
|
+
# Test suite for the win32-event library. This test should be run
|
5
5
|
# via the 'rake test' task.
|
6
6
|
#####################################################################
|
7
|
-
require
|
8
|
-
require
|
7
|
+
require 'test/unit'
|
8
|
+
require 'win32/event'
|
9
9
|
include Win32
|
10
10
|
|
11
11
|
class TC_Win32Event < Test::Unit::TestCase
|
@@ -18,7 +18,7 @@ class TC_Win32Event < Test::Unit::TestCase
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_version
|
21
|
-
assert_equal('0.5.
|
21
|
+
assert_equal('0.5.1', Event::VERSION)
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_constructor_errors
|
data/win32-event.gemspec
CHANGED
@@ -1,24 +1,29 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems'
|
2
2
|
|
3
3
|
spec = Gem::Specification.new do |gem|
|
4
|
-
gem.name =
|
5
|
-
gem.version =
|
6
|
-
gem.author =
|
7
|
-
gem.
|
8
|
-
gem.
|
4
|
+
gem.name = 'win32-event'
|
5
|
+
gem.version = '0.5.1'
|
6
|
+
gem.author = 'Daniel J. Berger'
|
7
|
+
gem.license = 'Artistic 2.0'
|
8
|
+
gem.email = 'djberg96@gmail.com'
|
9
|
+
gem.homepage = 'http://www.rubyforge.org/projects/win32utils'
|
9
10
|
gem.platform = Gem::Platform::RUBY
|
10
|
-
gem.summary =
|
11
|
-
gem.
|
12
|
-
gem.test_file = "test/tc_event.rb"
|
11
|
+
gem.summary = 'Interface to MS Windows Event objects.'
|
12
|
+
gem.test_file = 'test/test_win32_event.rb'
|
13
13
|
gem.has_rdoc = true
|
14
|
-
gem.files = Dir[
|
15
|
-
|
16
|
-
gem.
|
17
|
-
gem.
|
18
|
-
gem.add_dependency("win32-ipc", ">= 0.5.0")
|
19
|
-
end
|
14
|
+
gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
|
15
|
+
|
16
|
+
gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
|
17
|
+
gem.rubyforge_project = 'win32utils'
|
20
18
|
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
gem.add_dependency('win32-ipc', '>= 0.5.0')
|
20
|
+
|
21
|
+
gem.description = <<-EOF
|
22
|
+
The win32-event library provides an interface to Windows event objects.
|
23
|
+
An event object is a synchronization object whose state can be explicitly
|
24
|
+
set to a signaled state. Event objects are useful in sending a signal to
|
25
|
+
a thread indicating that a particular event has occurred.
|
26
|
+
EOF
|
24
27
|
end
|
28
|
+
|
29
|
+
Gem::Builder.new(spec).build
|
metadata
CHANGED
@@ -1,66 +1,72 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.0.8
|
3
|
-
specification_version: 1
|
4
2
|
name: win32-event
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.5.
|
7
|
-
date: 2007-05-03 00:00:00 -06:00
|
8
|
-
summary: Interface to MS Windows Event objects.
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: djberg96@gmail.com
|
12
|
-
homepage: http://www.rubyforge.org/projects/win32utils
|
13
|
-
rubyforge_project:
|
14
|
-
description: Interface to MS Windows Event objects.
|
15
|
-
autorequire:
|
16
|
-
default_executable:
|
17
|
-
bindir: bin
|
18
|
-
has_rdoc: true
|
19
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">"
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.0.0
|
24
|
-
version:
|
4
|
+
version: 0.5.1
|
25
5
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
6
|
authors:
|
30
7
|
- Daniel J. Berger
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
- test/tc_event.rb
|
35
|
-
- CHANGES
|
36
|
-
- CVS
|
37
|
-
- lib
|
38
|
-
- MANIFEST
|
39
|
-
- Rakefile
|
40
|
-
- README
|
41
|
-
- test
|
42
|
-
- win32-event.gemspec
|
43
|
-
test_files:
|
44
|
-
- test/tc_event.rb
|
45
|
-
rdoc_options: []
|
46
|
-
|
47
|
-
extra_rdoc_files:
|
48
|
-
- README
|
49
|
-
- CHANGES
|
50
|
-
- MANIFEST
|
51
|
-
executables: []
|
52
|
-
|
53
|
-
extensions: []
|
54
|
-
|
55
|
-
requirements: []
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
56
11
|
|
12
|
+
date: 2009-08-06 00:00:00 -06:00
|
13
|
+
default_executable:
|
57
14
|
dependencies:
|
58
15
|
- !ruby/object:Gem::Dependency
|
59
16
|
name: win32-ipc
|
17
|
+
type: :runtime
|
60
18
|
version_requirement:
|
61
|
-
version_requirements: !ruby/object:Gem::
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
62
20
|
requirements:
|
63
21
|
- - ">="
|
64
22
|
- !ruby/object:Gem::Version
|
65
23
|
version: 0.5.0
|
66
24
|
version:
|
25
|
+
description: " The win32-event library provides an interface to Windows event objects.\n An event object is a synchronization object whose state can be explicitly\n set to a signaled state. Event objects are useful in sending a signal to\n a thread indicating that a particular event has occurred.\n"
|
26
|
+
email: djberg96@gmail.com
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- README
|
33
|
+
- CHANGES
|
34
|
+
- MANIFEST
|
35
|
+
files:
|
36
|
+
- CHANGES
|
37
|
+
- lib/win32/event.rb
|
38
|
+
- MANIFEST
|
39
|
+
- Rakefile
|
40
|
+
- README
|
41
|
+
- test/test_win32_event.rb
|
42
|
+
- win32-event.gemspec
|
43
|
+
has_rdoc: true
|
44
|
+
homepage: http://www.rubyforge.org/projects/win32utils
|
45
|
+
licenses:
|
46
|
+
- Artistic 2.0
|
47
|
+
post_install_message:
|
48
|
+
rdoc_options: []
|
49
|
+
|
50
|
+
require_paths:
|
51
|
+
- lib
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: "0"
|
57
|
+
version:
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: "0"
|
63
|
+
version:
|
64
|
+
requirements: []
|
65
|
+
|
66
|
+
rubyforge_project: win32utils
|
67
|
+
rubygems_version: 1.3.4
|
68
|
+
signing_key:
|
69
|
+
specification_version: 3
|
70
|
+
summary: Interface to MS Windows Event objects.
|
71
|
+
test_files:
|
72
|
+
- test/test_win32_event.rb
|