ffi-win32-extensions 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +31 -0
- data/CODE_OF_CONDUCT.md +1 -0
- data/Gemfile +22 -0
- data/LICENSE +201 -201
- data/MANIFEST +9 -9
- data/README +48 -48
- data/README.md +57 -0
- data/Rakefile +53 -42
- data/VERSION +1 -0
- data/ffi-win32-extensions.gemspec +19 -25
- data/lib/ffi-win32-extensions.rb +1 -1
- data/lib/ffi/win32/extensions.rb +133 -96
- data/test/test_ffi_extensions.rb +41 -41
- data/test/test_string_extensions.rb +20 -20
- metadata +15 -57
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +0 -13
- data/certs/djberg96_pub.pem +0 -21
- metadata.gz.sig +0 -3
data/test/test_ffi_extensions.rb
CHANGED
@@ -1,41 +1,41 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
|
4
|
-
class TC_FFI_Win32_Extensions < Test::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
@ptr = FFI::MemoryPointer.new(:char)
|
7
|
-
end
|
8
|
-
|
9
|
-
test
|
10
|
-
assert_respond_to(@ptr, :read_array_of_string)
|
11
|
-
end
|
12
|
-
|
13
|
-
test
|
14
|
-
assert_respond_to(FFI, :windows_error_message)
|
15
|
-
assert_kind_of(String, FFI.windows_error_message(
|
16
|
-
end
|
17
|
-
|
18
|
-
test
|
19
|
-
expected =
|
20
|
-
assert_equal(expected, FFI.windows_error_message(
|
21
|
-
end
|
22
|
-
|
23
|
-
test
|
24
|
-
assert_respond_to(FFI, :raise_windows_error)
|
25
|
-
end
|
26
|
-
|
27
|
-
test
|
28
|
-
assert_respond_to(@ptr, :read_wide_string)
|
29
|
-
assert_kind_of(String, @ptr.read_wide_string)
|
30
|
-
end
|
31
|
-
|
32
|
-
test
|
33
|
-
assert_nothing_raised{ @ptr.read_wide_string }
|
34
|
-
assert_nothing_raised{ @ptr.read_wide_string(@ptr.size) }
|
35
|
-
end
|
36
|
-
|
37
|
-
def teardown
|
38
|
-
@ptr.free
|
39
|
-
@ptr = nil
|
40
|
-
end
|
41
|
-
end
|
1
|
+
require "ffi-win32-extensions"
|
2
|
+
require "test-unit"
|
3
|
+
|
4
|
+
class TC_FFI_Win32_Extensions < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
@ptr = FFI::MemoryPointer.new(:char)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "read_array_of_strings" do
|
10
|
+
assert_respond_to(@ptr, :read_array_of_string)
|
11
|
+
end
|
12
|
+
|
13
|
+
test "windows_error_message basic functionality" do
|
14
|
+
assert_respond_to(FFI, :windows_error_message)
|
15
|
+
assert_kind_of(String, FFI.windows_error_message("foo"))
|
16
|
+
end
|
17
|
+
|
18
|
+
test "windows_error_message returns the expected value" do
|
19
|
+
expected = "foo: The operation completed successfully."
|
20
|
+
assert_equal(expected, FFI.windows_error_message("foo", 0))
|
21
|
+
end
|
22
|
+
|
23
|
+
test "raise_windows_error" do
|
24
|
+
assert_respond_to(FFI, :raise_windows_error)
|
25
|
+
end
|
26
|
+
|
27
|
+
test "read_wide_string basic functionality" do
|
28
|
+
assert_respond_to(@ptr, :read_wide_string)
|
29
|
+
assert_kind_of(String, @ptr.read_wide_string)
|
30
|
+
end
|
31
|
+
|
32
|
+
test "read_wide_string has optional argument" do
|
33
|
+
assert_nothing_raised { @ptr.read_wide_string }
|
34
|
+
assert_nothing_raised { @ptr.read_wide_string(@ptr.size) }
|
35
|
+
end
|
36
|
+
|
37
|
+
def teardown
|
38
|
+
@ptr.free
|
39
|
+
@ptr = nil
|
40
|
+
end
|
41
|
+
end
|
@@ -1,20 +1,20 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
|
4
|
-
class TC_String_Win32_Extensions < Test::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
@string =
|
7
|
-
end
|
8
|
-
|
9
|
-
test
|
10
|
-
assert_respond_to(@string, :wincode)
|
11
|
-
end
|
12
|
-
|
13
|
-
test
|
14
|
-
assert_respond_to(@string, :wstrip)
|
15
|
-
end
|
16
|
-
|
17
|
-
def teardown
|
18
|
-
@string = nil
|
19
|
-
end
|
20
|
-
end
|
1
|
+
require "ffi-win32-extensions"
|
2
|
+
require "test-unit"
|
3
|
+
|
4
|
+
class TC_String_Win32_Extensions < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
@string = "foo/bar"
|
7
|
+
end
|
8
|
+
|
9
|
+
test "wincode" do
|
10
|
+
assert_respond_to(@string, :wincode)
|
11
|
+
end
|
12
|
+
|
13
|
+
test "wstrip" do
|
14
|
+
assert_respond_to(@string, :wstrip)
|
15
|
+
end
|
16
|
+
|
17
|
+
def teardown
|
18
|
+
@string = nil
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,36 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi-win32-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
-
|
12
|
-
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
|
14
|
-
cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
15
|
-
MB4XDTE1MDkwMjIwNDkxOFoXDTE2MDkwMTIwNDkxOFowPzERMA8GA1UEAwwIZGpi
|
16
|
-
ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
|
17
|
-
bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMyTkvXqRp6hLs9eoJOS
|
18
|
-
Hmi8kRYb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00:00:00.000000000 Z
|
34
12
|
dependencies:
|
35
13
|
- !ruby/object:Gem::Dependency
|
36
14
|
name: ffi
|
@@ -46,20 +24,6 @@ dependencies:
|
|
46
24
|
- - ">="
|
47
25
|
- !ruby/object:Gem::Version
|
48
26
|
version: '0'
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: test-unit
|
51
|
-
requirement: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - ">="
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '0'
|
56
|
-
type: :development
|
57
|
-
prerelease: false
|
58
|
-
version_requirements: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
63
27
|
description: |2
|
64
28
|
The ffi-win32-extensions library adds additional methods to the FFI
|
65
29
|
and String classes to aid in the development of FFI based libraries
|
@@ -67,28 +31,23 @@ description: |2
|
|
67
31
|
email: djberg96@gmail.com
|
68
32
|
executables: []
|
69
33
|
extensions: []
|
70
|
-
extra_rdoc_files:
|
71
|
-
- README
|
72
|
-
- CHANGES
|
73
|
-
- MANIFEST
|
34
|
+
extra_rdoc_files: []
|
74
35
|
files:
|
75
|
-
-
|
76
|
-
-
|
77
|
-
-
|
78
|
-
- ffi-win32-extensions.gemspec
|
79
|
-
- lib
|
80
|
-
- lib/ffi
|
81
|
-
- lib/ffi/win32
|
82
|
-
- lib/ffi/win32/extensions.rb
|
83
|
-
- lib/ffi-win32-extensions.rb
|
36
|
+
- CHANGELOG.md
|
37
|
+
- CODE_OF_CONDUCT.md
|
38
|
+
- Gemfile
|
84
39
|
- LICENSE
|
85
40
|
- MANIFEST
|
86
|
-
- Rakefile
|
87
41
|
- README
|
88
|
-
-
|
42
|
+
- README.md
|
43
|
+
- Rakefile
|
44
|
+
- VERSION
|
45
|
+
- ffi-win32-extensions.gemspec
|
46
|
+
- lib/ffi-win32-extensions.rb
|
47
|
+
- lib/ffi/win32/extensions.rb
|
89
48
|
- test/test_ffi_extensions.rb
|
90
49
|
- test/test_string_extensions.rb
|
91
|
-
homepage: http://github.com/
|
50
|
+
homepage: http://github.com/chef/ffi-win32-extensions
|
92
51
|
licenses:
|
93
52
|
- Apache 2.0
|
94
53
|
metadata: {}
|
@@ -107,8 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
66
|
- !ruby/object:Gem::Version
|
108
67
|
version: '0'
|
109
68
|
requirements: []
|
110
|
-
|
111
|
-
rubygems_version: 2.5.1
|
69
|
+
rubygems_version: 3.0.3
|
112
70
|
signing_key:
|
113
71
|
specification_version: 4
|
114
72
|
summary: Extends the FFI and String classes on MS Windows
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data.tar.gz.sig
DELETED
Binary file
|
data/CHANGES
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
= 1.0.3 - 21-Aug-2016
|
2
|
-
* The FFI::MemoryPointer#read_wide_string now defaults to its own size
|
3
|
-
for the +num_bytes+ argument.
|
4
|
-
|
5
|
-
= 1.0.2 - 20-Jun-2016
|
6
|
-
* Added the String#read_wide_string method.
|
7
|
-
* Refactored the windows_error_message method a bit.
|
8
|
-
|
9
|
-
= 1.0.1 - 8-May-2016
|
10
|
-
* The String#wstrip method defaults to nil on failure.
|
11
|
-
|
12
|
-
= 1.0.0 - 7-May-2016
|
13
|
-
* Initial release
|
data/certs/djberg96_pub.pem
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
|
3
|
-
cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
4
|
-
MB4XDTE1MDkwMjIwNDkxOFoXDTE2MDkwMTIwNDkxOFowPzERMA8GA1UEAwwIZGpi
|
5
|
-
ZXJnOTYxFTATBgoJkiaJk/IsZ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