win32-eventlog 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +7 -0
- data/Rakefile +1 -1
- data/lib/win32/eventlog.rb +6 -5
- data/lib/win32/windows/constants.rb +1 -1
- data/lib/win32/windows/functions.rb +1 -1
- data/lib/win32/windows/structs.rb +1 -1
- data/test/test_eventlog.rb +11 -5
- data/test/test_mc.rb +3 -2
- data/win32-eventlog.gemspec +1 -1
- metadata +16 -9
- metadata.gz.sig +0 -0
- data/lib/win32/windows/helper.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddf12eaa4b419f111eb52ec1e88c2eeb79f37ce8
|
4
|
+
data.tar.gz: bc574189877a4c4d8d37c66e65e80f1a8c8ceb18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae2df2fe096c4fd6729f3c3b38779af85d3902f635b1882d28eddf2d1aabfb6b322f111541ca6a6975f9ae24a6bc3ebfa6be12ee634ac8a2f5808991c8964a50
|
7
|
+
data.tar.gz: 81b27c47f295da3352559f6cc241b3b1793aed86e072a7007c41d436dbcc3f32877101172f5325115e4208ccda748e0c04ab5fe48b82e060efc552a0df86c39b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 0.6.6 - 25-Jun-2016
|
2
|
+
* Renamed the various modules that contain FFI information in order to
|
3
|
+
avoid a namespacing conflict. Thanks go to Bryan McLellan for the spot.
|
4
|
+
* Removed the helper.rb file which wasn't being used.
|
5
|
+
* Updated a few tests to not assume there are actually records in the
|
6
|
+
Application event log. Mostly this was for Appveyor.
|
7
|
+
|
1
8
|
== 0.6.5 - 29-Oct-2015
|
2
9
|
* Fixed some old code in the read method that was never properly updated.
|
3
10
|
Thanks go to Jo�o Duarte for the spot.
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ namespace :gem do
|
|
10
10
|
require 'rubygems/package'
|
11
11
|
spec = eval(IO.read('win32-eventlog.gemspec'))
|
12
12
|
spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
|
13
|
-
Gem::Package.build(spec)
|
13
|
+
Gem::Package.build(spec, true)
|
14
14
|
end
|
15
15
|
|
16
16
|
desc 'Install the win32-eventlog gem'
|
data/lib/win32/eventlog.rb
CHANGED
@@ -8,17 +8,17 @@ module Win32
|
|
8
8
|
# The EventLog class encapsulates an Event Log source and provides methods
|
9
9
|
# for interacting with that source.
|
10
10
|
class EventLog
|
11
|
-
include Windows::
|
12
|
-
include Windows::
|
13
|
-
include Windows::
|
14
|
-
extend Windows::
|
11
|
+
include Windows::EventLogConstants
|
12
|
+
include Windows::EventLogStructs
|
13
|
+
include Windows::EventLogFunctions
|
14
|
+
extend Windows::EventLogFunctions
|
15
15
|
|
16
16
|
# The EventLog::Error is raised in cases where interaction with the
|
17
17
|
# event log should happen to fail for any reason.
|
18
18
|
class Error < StandardError; end
|
19
19
|
|
20
20
|
# The version of the win32-eventlog library
|
21
|
-
VERSION = '0.6.
|
21
|
+
VERSION = '0.6.6'
|
22
22
|
|
23
23
|
# The log is read in chronological order, i.e. oldest to newest.
|
24
24
|
FORWARDS_READ = EVENTLOG_FORWARDS_READ
|
@@ -1051,6 +1051,7 @@ module Win32
|
|
1051
1051
|
)
|
1052
1052
|
|
1053
1053
|
if res == 0
|
1054
|
+
buf.clear
|
1054
1055
|
event_id = 0xB0000000 | event_id
|
1055
1056
|
|
1056
1057
|
res = FormatMessage(
|
data/test/test_eventlog.rb
CHANGED
@@ -25,7 +25,7 @@ class TC_Win32_EventLog < Test::Unit::TestCase
|
|
25
25
|
end
|
26
26
|
|
27
27
|
test "version constant is set to expected value" do
|
28
|
-
assert_equal('0.6.
|
28
|
+
assert_equal('0.6.6', EventLog::VERSION)
|
29
29
|
end
|
30
30
|
|
31
31
|
test "constructor basic functionality" do
|
@@ -177,20 +177,26 @@ class TC_Win32_EventLog < Test::Unit::TestCase
|
|
177
177
|
end
|
178
178
|
|
179
179
|
test "seek_read flag plus forwards_read flag works as expected" do
|
180
|
+
assert_nothing_raised{ @last = @log.read[-10] }
|
181
|
+
|
182
|
+
omit_unless(@last, "No records found, skipping")
|
180
183
|
flags = EventLog::SEEK_READ | EventLog::FORWARDS_READ
|
181
|
-
|
184
|
+
|
182
185
|
assert_nothing_raised{
|
183
|
-
@records = EventLog.read(nil, nil, flags, @last)
|
186
|
+
@records = EventLog.read(nil, nil, flags, @last.record_number)
|
184
187
|
}
|
188
|
+
|
185
189
|
assert_equal(10, @records.length)
|
186
190
|
end
|
187
191
|
|
188
|
-
#
|
192
|
+
# Allowing for 0 records is mostly for appveyor. I really need a more
|
193
|
+
# robust test approach here.
|
194
|
+
#
|
189
195
|
test "seek_read flag plus backwards_read flag works as expected" do
|
190
196
|
flags = EventLog::SEEK_READ | EventLog::BACKWARDS_READ
|
191
197
|
assert_nothing_raised{ @last = @log.oldest_record_number + 10 }
|
192
198
|
assert_nothing_raised{ @records = EventLog.read(nil, nil, flags, @last) }
|
193
|
-
|
199
|
+
assert_true([0,11].include?(@records.length))
|
194
200
|
end
|
195
201
|
|
196
202
|
test "the eventlog struct returned by read is frozen" do
|
data/test/test_mc.rb
CHANGED
@@ -37,13 +37,14 @@ class TC_Win32_MC < Test::Unit::TestCase
|
|
37
37
|
def test_03_create_res_file
|
38
38
|
omit_if(@@rc_cmd.nil?, "'rc' command not found - skipping")
|
39
39
|
assert_respond_to(@mc, :create_res_file)
|
40
|
-
|
40
|
+
assert_true(@mc.create_res_file)
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_04_create_dll_file
|
44
44
|
omit_if(@@link_cmd.nil?, "'link' command not found - skipping")
|
45
|
+
omit_unless(File.exist?(@mc.res_file), 'no res_file found - skipping')
|
45
46
|
assert_respond_to(@mc, :create_dll_file)
|
46
|
-
|
47
|
+
assert_true(@mc.create_dll_file)
|
47
48
|
end
|
48
49
|
|
49
50
|
def test_05_clean
|
data/win32-eventlog.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: win32-eventlog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
EJYzxdPOrx2n6NYR3Hk+vHP0U7UBSveI6+qx+ndQYaeyCn+GRX2PKS9h66YF/Q1V
|
32
32
|
tGSHgAmcLlkdGgan182qsE/4kKM=
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2016-06-25 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: ffi
|
@@ -105,24 +105,31 @@ extra_rdoc_files:
|
|
105
105
|
- MANIFEST
|
106
106
|
- doc/tutorial.txt
|
107
107
|
files:
|
108
|
-
-
|
109
|
-
- MANIFEST
|
110
|
-
- README
|
111
|
-
- Rakefile
|
108
|
+
- certs
|
112
109
|
- certs/djberg96_pub.pem
|
110
|
+
- CHANGES
|
111
|
+
- doc
|
113
112
|
- doc/tutorial.txt
|
113
|
+
- examples
|
114
114
|
- examples/example_notify.rb
|
115
115
|
- examples/example_read.rb
|
116
116
|
- examples/example_write.rb
|
117
|
-
- lib
|
117
|
+
- lib
|
118
|
+
- lib/win32
|
118
119
|
- lib/win32/eventlog.rb
|
119
120
|
- lib/win32/mc.rb
|
121
|
+
- lib/win32/windows
|
120
122
|
- lib/win32/windows/constants.rb
|
121
123
|
- lib/win32/windows/functions.rb
|
122
|
-
- lib/win32/windows/helper.rb
|
123
124
|
- lib/win32/windows/structs.rb
|
125
|
+
- lib/win32-eventlog.rb
|
126
|
+
- MANIFEST
|
127
|
+
- misc
|
124
128
|
- misc/install_msg.rb
|
125
129
|
- misc/rubymsg.mc
|
130
|
+
- Rakefile
|
131
|
+
- README
|
132
|
+
- test
|
126
133
|
- test/foo.mc
|
127
134
|
- test/test_eventlog.rb
|
128
135
|
- test/test_mc.rb
|
@@ -147,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
154
|
version: '0'
|
148
155
|
requirements: []
|
149
156
|
rubyforge_project:
|
150
|
-
rubygems_version: 2.4
|
157
|
+
rubygems_version: 2.6.4
|
151
158
|
signing_key:
|
152
159
|
specification_version: 4
|
153
160
|
summary: Interface for the MS Windows Event Log.
|
metadata.gz.sig
CHANGED
Binary file
|
data/lib/win32/windows/helper.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
class String
|
2
|
-
# Convenience method for converting strings to UTF-16LE for wide character
|
3
|
-
# functions that require it.
|
4
|
-
def wincode
|
5
|
-
(self.tr(File::SEPARATOR, File::ALT_SEPARATOR) + 0.chr).encode('UTF-16LE')
|
6
|
-
end
|
7
|
-
|
8
|
-
# Read a wide character string up until the first double null, and delete
|
9
|
-
# any remaining null characters.
|
10
|
-
def read_wide
|
11
|
-
self[/^.*?(?=\x00{2})/].delete(0.chr)
|
12
|
-
end
|
13
|
-
end
|