win32-event 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8655219bfc22558c6379c74c808071b1e1f375c7
4
+ data.tar.gz: 4c04ff1c2d0724a573f6645453a3e5b2a8b76302
5
+ SHA512:
6
+ metadata.gz: 0efc8c91b25e60584b81ef4defa842bfa4be5a2187c55388b81f92a2b347e9a7f9afaec47011320839e813f023d6ae081b1e4e5a72518c1657a4df274683559a
7
+ data.tar.gz: 6d91aeaf301dbd5659392bc9e6ebae688b106495476579767afde79d5e3864cf0fed0af9e43d9dc38b857120d1ba4da204bee338e21705c206164e96532e331e
checksums.yaml.gz.sig ADDED
Binary file
data.tar.gz.sig ADDED
Binary file
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.6.2 - 24-Oct-2015
2
+ * Change most bools to ints. This required explicitly defining some
3
+ attribute reader methods as well.
4
+ * The gem is now signed.
5
+ * Cleanup and updates for the Rakefile and gemspec.
6
+
1
7
  == 0.6.1 - 9-Apr-2013
2
8
  * Fixed the HANDLE datatypes in the underlying FFI code. This addresses
3
9
  an issue for 64 bit versions of Ruby.
data/MANIFEST CHANGED
@@ -3,5 +3,6 @@
3
3
  * README
4
4
  * Rakefile
5
5
  * win32-event.gemspec
6
+ * certs/djberg96_pub.pem
6
7
  * lib/win32/event.rb
7
- * test/test_win32_event.rb
8
+ * test/test_win32_event.rb
data/Rakefile CHANGED
@@ -7,14 +7,16 @@ CLEAN.include("**/*.gem", "**/*.rbc")
7
7
  namespace 'gem' do
8
8
  desc 'Create the win32-event gem'
9
9
  task :create => [:clean] do
10
+ require 'rubygems/package'
10
11
  spec = eval(IO.read('win32-event.gemspec'))
11
- Gem::Builder.new(spec).build
12
+ spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
13
+ Gem::Package.build(spec)
12
14
  end
13
15
 
14
16
  desc 'Install the win32-event gem'
15
17
  task :install => [:clean, :create] do
16
18
  file = Dir['*.gem'].first
17
- sh "gem install #{file}"
19
+ sh "gem install -l #{file}"
18
20
  end
19
21
  end
20
22
 
@@ -0,0 +1,21 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
3
+ cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
4
+ MB4XDTE1MDkwMjIwNDkxOFoXDTE2MDkwMTIwNDkxOFowPzERMA8GA1UEAwwIZGpi
5
+ ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
6
+ bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMyTkvXqRp6hLs9eoJOS
7
+ Hmi8kRYbq9Vkf15/hMxJpotYMgJVHHWrmDcC5Dye2PbnXjTkKf266Zw0PtT9h+lI
8
+ S3ts9HO+vaCFSMwFFZmnWJSpQ3CNw2RcHxjWkk9yF7imEM8Kz9ojhiDXzBetdV6M
9
+ gr0lV/alUr7TNVBDngbXEfTWscyXh1qd7xZ4EcOdsDktCe5G45N/o3662tPQvJsi
10
+ FOF0CM/KuBsa/HL1/eoEmF4B3EKIRfTHrQ3hu20Kv3RJ88QM4ec2+0dd97uX693O
11
+ zv6981fyEg+aXLkxrkViM/tz2qR2ZE0jPhHTREPYeMEgptRkTmWSKAuLVWrJEfgl
12
+ DtkCAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFEwe
13
+ nn6bfJADmuIDiMSOzedOrL+xMB0GA1UdEQQWMBSBEmRqYmVyZzk2QGdtYWlsLmNv
14
+ bTAdBgNVHRIEFjAUgRJkamJlcmc5NkBnbWFpbC5jb20wDQYJKoZIhvcNAQEFBQAD
15
+ ggEBAHmNOCWoDVD75zHFueY0viwGDVP1BNGFC+yXcb7u2GlK+nEMCORqzURbYPf7
16
+ tL+/hzmePIRz7i30UM//64GI1NLv9jl7nIwjhPpXpf7/lu2I9hOTsvwSumb5UiKC
17
+ /sqBxI3sfj9pr79Wpv4MuikX1XPik7Ncb7NPsJPw06Lvyc3Hkg5X2XpPtLtS+Gr2
18
+ wKJnmzb5rIPS1cmsqv0M9LPWflzfwoZ/SpnmhagP+g05p8bRNKjZSA2iImM/GyYZ
19
+ EJYzxdPOrx2n6NYR3Hk+vHP0U7UBSveI6+qx+ndQYaeyCn+GRX2PKS9h66YF/Q1V
20
+ tGSHgAmcLlkdGgan182qsE/4kKM=
21
+ -----END CERTIFICATE-----
data/lib/win32/event.rb CHANGED
@@ -14,12 +14,12 @@ module Win32
14
14
  layout(
15
15
  :nLength, :ulong,
16
16
  :lpSecurityDescriptor, :pointer,
17
- :bInheritHandle, :bool
17
+ :bInheritHandle, :int
18
18
  )
19
19
  end
20
20
 
21
- attach_function :CreateEvent, :CreateEventW, [:pointer, :bool, :bool, :buffer_in], :handle
22
- attach_function :OpenEvent, :OpenEventW, [:ulong, :bool, :buffer_in], :handle
21
+ attach_function :CreateEvent, :CreateEventW, [:pointer, :int, :int, :buffer_in], :handle
22
+ attach_function :OpenEvent, :OpenEventW, [:ulong, :int, :buffer_in], :handle
23
23
  attach_function :SetEvent, [:handle], :bool
24
24
  attach_function :ResetEvent, [:handle], :bool
25
25
 
@@ -32,22 +32,12 @@ module Win32
32
32
  class Error < StandardError; end
33
33
 
34
34
  # The version of the win32-event library
35
- VERSION = '0.6.1'
35
+ VERSION = '0.6.2'
36
36
 
37
37
  # The name of the Event object. The default is nil
38
38
  #
39
39
  attr_reader :name
40
40
 
41
- # Indicates whether or not the Event requires use of the ResetEvent()
42
- # function set the state to nonsignaled. The default is false
43
- #
44
- attr_reader :manual_reset
45
-
46
- # The initial state of the Event object. If true, the initial state
47
- # is signaled. Otherwise, it is non-signaled. The default is false.
48
- #
49
- attr_reader :initial_state
50
-
51
41
  # Creates and returns new Event object. If +name+ is omitted, the
52
42
  # Event object is created without a name, i.e. it's anonymous.
53
43
  #
@@ -70,11 +60,11 @@ module Win32
70
60
  # In block form this will automatically close the Event object at the
71
61
  # end of the block.
72
62
  #
73
- def initialize(name=nil, man_reset=false, init_state=false, inherit=true)
63
+ def initialize(name=nil, manual_reset=false, init_state=false, inherit=true)
74
64
  @name = name
75
- @manual_reset = man_reset
76
- @initial_state = init_state
77
- @inherit = inherit
65
+ @manual_reset = manual_reset ? 1 : 0
66
+ @initial_state = init_state ? 1 : 0
67
+ @inherit = inherit ? 1 : 0
78
68
 
79
69
  if name.is_a?(String)
80
70
  if name.encoding.to_s != 'UTF-16LE'
@@ -88,12 +78,12 @@ module Win32
88
78
  if inherit
89
79
  sec = SecurityAttributes.new
90
80
  sec[:nLength] = SecurityAttributes.size
91
- sec[:bInheritHandle] = inherit
81
+ sec[:bInheritHandle] = @inherit
92
82
  else
93
83
  sec = nil
94
84
  end
95
85
 
96
- handle = CreateEvent(sec, manual_reset, initial_state, name)
86
+ handle = CreateEvent(sec, @manual_reset, @initial_state, name)
97
87
 
98
88
  if handle == 0 || handle == INVALID_HANDLE_VALUE
99
89
  raise SystemCallError.new("CreateEvent", FFI.errno)
@@ -117,6 +107,8 @@ module Win32
117
107
  def self.open(name, inherit=true, &block)
118
108
  raise TypeError unless name.is_a?(String)
119
109
 
110
+ inheritable = inherit ? 1 : 0
111
+
120
112
  if name.encoding.to_s != 'UTF-16LE'
121
113
  oname = name + 0.chr
122
114
  oname.encode!('UTF-16LE')
@@ -127,7 +119,7 @@ module Win32
127
119
  # This block of code is here strictly to force an error if the user
128
120
  # tries to open an event that doesn't already exist.
129
121
  begin
130
- h = OpenEvent(EVENT_ALL_ACCESS, inherit, oname)
122
+ h = OpenEvent(EVENT_ALL_ACCESS, inheritable, oname)
131
123
 
132
124
  if h == 0 || h == INVALID_HANDLE_VALUE
133
125
  raise SystemCallError.new("OpenEvent", FFI.errno)
@@ -139,12 +131,30 @@ module Win32
139
131
  self.new(name, false, false, inherit, &block)
140
132
  end
141
133
 
134
+ # Indicates whether or not the Event requires use of the ResetEvent()
135
+ # function set the state to nonsignaled. The default is false
136
+ #
137
+ def manual_reset
138
+ [1, true].include?(@manual_reset)
139
+ end
140
+
141
+ alias manual_reset? manual_reset
142
+
143
+ # The initial state of the Event object. If true, the initial state
144
+ # is signaled. Otherwise, it is non-signaled. The default is false.
145
+ #
146
+ def initial_state
147
+ [1, true].include?(@initial_state)
148
+ end
149
+
150
+ alias initial_state? initial_state
151
+
142
152
  # Returns whether or not the object was opened such that a process
143
153
  # created by the CreateProcess() function (a Windows API function) can
144
154
  # inherit the handle. The default is true.
145
155
  #
146
156
  def inheritable?
147
- @inherit
157
+ [1, true].include?(@inherit)
148
158
  end
149
159
 
150
160
  # Sets the Event object to a non-signaled state.
@@ -18,7 +18,7 @@ class TC_Win32Event < Test::Unit::TestCase
18
18
  end
19
19
 
20
20
  test "version is set to expected value" do
21
- assert_equal('0.6.1', Event::VERSION)
21
+ assert_equal('0.6.2', Event::VERSION)
22
22
  end
23
23
 
24
24
  test "constructor works with no arguments" do
data/win32-event.gemspec CHANGED
@@ -1,18 +1,18 @@
1
1
  require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
- spec.name = 'win32-event'
5
- spec.version = '0.6.1'
6
- spec.author = 'Daniel J. Berger'
7
- spec.license = 'Artistic 2.0'
8
- spec.email = 'djberg96@gmail.com'
9
- spec.homepage = 'http://github.com/djberg96/win32-event'
10
- spec.summary = 'Interface to MS Windows Event objects.'
11
- spec.test_file = 'test/test_win32_event.rb'
12
- spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
4
+ spec.name = 'win32-event'
5
+ spec.version = '0.6.2'
6
+ spec.author = 'Daniel J. Berger'
7
+ spec.license = 'Artistic 2.0'
8
+ spec.email = 'djberg96@gmail.com'
9
+ spec.homepage = 'http://github.com/djberg96/win32-event'
10
+ spec.summary = 'Interface to MS Windows Event objects.'
11
+ spec.test_file = 'test/test_win32_event.rb'
12
+ spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
13
+ spec.cert_chain = ['certs/djberg96_pub.pem']
13
14
 
14
- spec.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
15
- spec.rubyforge_project = 'win32utils'
15
+ spec.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
16
16
  spec.required_ruby_version = '> 1.9.0'
17
17
 
18
18
  spec.add_dependency('win32-ipc', '>= 0.6.0')
metadata CHANGED
@@ -1,52 +1,70 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
5
- prerelease:
4
+ version: 0.6.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Daniel J. Berger
9
8
  autorequire:
10
9
  bindir: bin
11
- cert_chain: []
12
- date: 2013-04-09 00:00:00.000000000 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
14
+ cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
15
+ MB4XDTE1MDkwMjIwNDkxOFoXDTE2MDkwMTIwNDkxOFowPzERMA8GA1UEAwwIZGpi
16
+ ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
17
+ bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMyTkvXqRp6hLs9eoJOS
18
+ Hmi8kRYbq9Vkf15/hMxJpotYMgJVHHWrmDcC5Dye2PbnXjTkKf266Zw0PtT9h+lI
19
+ S3ts9HO+vaCFSMwFFZmnWJSpQ3CNw2RcHxjWkk9yF7imEM8Kz9ojhiDXzBetdV6M
20
+ gr0lV/alUr7TNVBDngbXEfTWscyXh1qd7xZ4EcOdsDktCe5G45N/o3662tPQvJsi
21
+ FOF0CM/KuBsa/HL1/eoEmF4B3EKIRfTHrQ3hu20Kv3RJ88QM4ec2+0dd97uX693O
22
+ zv6981fyEg+aXLkxrkViM/tz2qR2ZE0jPhHTREPYeMEgptRkTmWSKAuLVWrJEfgl
23
+ DtkCAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFEwe
24
+ nn6bfJADmuIDiMSOzedOrL+xMB0GA1UdEQQWMBSBEmRqYmVyZzk2QGdtYWlsLmNv
25
+ bTAdBgNVHRIEFjAUgRJkamJlcmc5NkBnbWFpbC5jb20wDQYJKoZIhvcNAQEFBQAD
26
+ ggEBAHmNOCWoDVD75zHFueY0viwGDVP1BNGFC+yXcb7u2GlK+nEMCORqzURbYPf7
27
+ tL+/hzmePIRz7i30UM//64GI1NLv9jl7nIwjhPpXpf7/lu2I9hOTsvwSumb5UiKC
28
+ /sqBxI3sfj9pr79Wpv4MuikX1XPik7Ncb7NPsJPw06Lvyc3Hkg5X2XpPtLtS+Gr2
29
+ wKJnmzb5rIPS1cmsqv0M9LPWflzfwoZ/SpnmhagP+g05p8bRNKjZSA2iImM/GyYZ
30
+ EJYzxdPOrx2n6NYR3Hk+vHP0U7UBSveI6+qx+ndQYaeyCn+GRX2PKS9h66YF/Q1V
31
+ tGSHgAmcLlkdGgan182qsE/4kKM=
32
+ -----END CERTIFICATE-----
33
+ date: 2015-10-24 00:00:00.000000000 Z
13
34
  dependencies:
14
35
  - !ruby/object:Gem::Dependency
15
36
  name: win32-ipc
16
37
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
38
  requirements:
19
- - - ! '>='
39
+ - - ">="
20
40
  - !ruby/object:Gem::Version
21
41
  version: 0.6.0
22
42
  type: :runtime
23
43
  prerelease: false
24
44
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
45
  requirements:
27
- - - ! '>='
46
+ - - ">="
28
47
  - !ruby/object:Gem::Version
29
48
  version: 0.6.0
30
49
  - !ruby/object:Gem::Dependency
31
50
  name: test-unit
32
51
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
52
  requirements:
35
- - - ! '>='
53
+ - - ">="
36
54
  - !ruby/object:Gem::Version
37
55
  version: '0'
38
56
  type: :development
39
57
  prerelease: false
40
58
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
59
  requirements:
43
- - - ! '>='
60
+ - - ">="
44
61
  - !ruby/object:Gem::Version
45
62
  version: '0'
46
- description: ! " The win32-event library provides an interface to Windows event
47
- objects.\n An event object is a synchronization object whose state can be explicitly\n
48
- \ set to a signaled state. Event objects are useful in sending a signal to\n a
49
- thread indicating that a particular event has occurred.\n"
63
+ description: |2
64
+ The win32-event library provides an interface to Windows event objects.
65
+ An event object is a synchronization object whose state can be explicitly
66
+ set to a signaled state. Event objects are useful in sending a signal to
67
+ a thread indicating that a particular event has occurred.
50
68
  email: djberg96@gmail.com
51
69
  executables: []
52
70
  extensions: []
@@ -56,36 +74,36 @@ extra_rdoc_files:
56
74
  - MANIFEST
57
75
  files:
58
76
  - CHANGES
59
- - lib/win32/event.rb
60
77
  - MANIFEST
61
- - Rakefile
62
78
  - README
79
+ - Rakefile
80
+ - certs/djberg96_pub.pem
81
+ - lib/win32/event.rb
63
82
  - test/test_win32_event.rb
64
83
  - win32-event.gemspec
65
84
  homepage: http://github.com/djberg96/win32-event
66
85
  licenses:
67
86
  - Artistic 2.0
87
+ metadata: {}
68
88
  post_install_message:
69
89
  rdoc_options: []
70
90
  require_paths:
71
91
  - lib
72
92
  required_ruby_version: !ruby/object:Gem::Requirement
73
- none: false
74
93
  requirements:
75
- - - ! '>'
94
+ - - ">"
76
95
  - !ruby/object:Gem::Version
77
96
  version: 1.9.0
78
97
  required_rubygems_version: !ruby/object:Gem::Requirement
79
- none: false
80
98
  requirements:
81
- - - ! '>='
99
+ - - ">="
82
100
  - !ruby/object:Gem::Version
83
101
  version: '0'
84
102
  requirements: []
85
- rubyforge_project: win32utils
86
- rubygems_version: 1.8.24
103
+ rubyforge_project:
104
+ rubygems_version: 2.4.8
87
105
  signing_key:
88
- specification_version: 3
106
+ specification_version: 4
89
107
  summary: Interface to MS Windows Event objects.
90
108
  test_files:
91
109
  - test/test_win32_event.rb
metadata.gz.sig ADDED
Binary file