ffi-win32-extensions 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 222fca76d4a26f80510379101b6cdcbb35983631
4
- data.tar.gz: c552a2d5f78aafd64c993fed870819d3f983b4b9
3
+ metadata.gz: 73427e6e8cc496f2e8ce9cbf9b2a713bec9e4cab
4
+ data.tar.gz: aa09c51f1c39f81d5de44f76b8b5efd62704923f
5
5
  SHA512:
6
- metadata.gz: ed1b217b84bf3bc93e382766f156aa8bfc88726a8cf20a51527d1f88bcff208b2e6bf729b70c61d06c5196219e82470b7a7c24d199efc6bdb79b2fb1648defa3
7
- data.tar.gz: dd629833b40839498f2a49688a4cbe12bb8dfb6d78f81acc6a4dbb631a1710b4fa3e79d152a584a6a7df76391abcfe66b7d89beab212d878f53190d5c1da0a7f
6
+ metadata.gz: f7ecb5849b690d0272b43a9f3dfa2c76278478d15e45f6c6ba9acec79c02d922ec8ca66ba3823784ce3ad209ef7a351f39ce29ccc2ad32ef714eef4bccf55e0c
7
+ data.tar.gz: 1fdb867ec07afccf0dfb740b96a67d1d836a0bb2197fbcb582f3eb8b3be65671df573afd4148c48e80b55ab4c484c5498068636827a3581acc3fe3d7ff0071fb
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
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
+
1
5
  = 1.0.2 - 20-Jun-2016
2
6
  * Added the String#read_wide_string method.
3
7
  * Refactored the windows_error_message method a bit.
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'ffi-win32-extensions'
5
- spec.version = '1.0.2'
5
+ spec.version = '1.0.3'
6
6
  spec.authors = 'Daniel J. Berger'
7
7
  spec.license = 'Apache 2.0'
8
8
  spec.email = 'djberg96@gmail.com'
@@ -18,7 +18,7 @@ class FFI::Pointer
18
18
 
19
19
  # Read +num_bytes+ from a wide character string pointer.
20
20
  #
21
- def read_wide_string(num_bytes)
21
+ def read_wide_string(num_bytes = self.size)
22
22
  read_bytes(num_bytes).force_encoding('UTF-16LE')
23
23
  .encode('UTF-8', :invalid => :replace, :undef => :replace)
24
24
  .split(0.chr).first.force_encoding(Encoding.default_external)
@@ -24,6 +24,16 @@ class TC_FFI_Win32_Extensions < Test::Unit::TestCase
24
24
  assert_respond_to(FFI, :raise_windows_error)
25
25
  end
26
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
+
27
37
  def teardown
28
38
  @ptr.free
29
39
  @ptr = nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-win32-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -30,7 +30,7 @@ cert_chain:
30
30
  EJYzxdPOrx2n6NYR3Hk+vHP0U7UBSveI6+qx+ndQYaeyCn+GRX2PKS9h66YF/Q1V
31
31
  tGSHgAmcLlkdGgan182qsE/4kKM=
32
32
  -----END CERTIFICATE-----
33
- date: 2016-06-21 00:00:00.000000000 Z
33
+ date: 2016-08-21 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: ffi
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.6.4
111
+ rubygems_version: 2.5.1
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Extends the FFI and String classes on MS Windows
metadata.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- ��nW4y���aT4)��8�0MC)�Hf���UB�)�����+C��q��1��%!��^Tȕ����t ���bE�{��̴�$�T�ܨ�dy#u��~�!��7�+X��NG�F/�7��5����n\9��Ʈl��F{o0NW��r"K;7 ���E�#m�ӗvgOO^��xf���'ƅ� ����ʝ�'j>"
2
- ,E�ԡǃ$�k�`�'ѻdM|*�B �����h疴t�D``�<.|�e�����
1
+ ��t��c���?�w��c{�m��i1j6^�템@wW���di��w F���15ڏy+�m3ɗoU�d���,�5h�����.XG �H&�����"o���?V
2
+ �� �tV��8Е. ��9H}�K�eH'˛��(
3
+ ��Wt�,_�'�S<eG �1L��r��ߪ�,�z.�Ņ���87ܱ��8�S�