gir_ffi 0.11.2 → 0.11.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: 73e67fc346dc57b0f0c5aae7d10f3e289cc7db12
4
- data.tar.gz: 2cad0fc312a8ee19389ea4b25402fcd73d12c912
3
+ metadata.gz: d1e39bcc0f9f9fcac282b4b73a70afcf38f07696
4
+ data.tar.gz: 8f62a51f4fc6ce78aca5e2d88fd756aca059561d
5
5
  SHA512:
6
- metadata.gz: 51a5c7448e876c1b9ca00c5fb61a88f6d1696382af21a140dbb5825ef9e9a7ee1a18ad2c9e8ca58431a187c9f10756ed0696e57d1c035e93a8aa13b632f9870e
7
- data.tar.gz: 821c2b03f0f2547c2167f6f4d150e95fbeeff002ca6fdf78657d8b8c71e6f71b3ab1aabd4011be1a258429060547f5fcf65b327d95e4c1a53d4c35d762d06c08
6
+ metadata.gz: bb3dc4825b39325387310a3509772f72fa4df20907ba7aca1ebfba0f98f3b5390bbe345a9abbaf2ee1d6b1c7e58e468d1d8c94966d794e9840f8075543e74144
7
+ data.tar.gz: 7fbb7f35d22e0b552c5538c984a567f06ad67f98f90963f49c351603ed1652ac9206c7d47c60229737202942115155ce802c0ba5b1628900bfa9a11b92f6eed6
data/Changelog.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## 0.11.1 / 2017-04-20
3
+ ## 0.11.3 / 2017-05-05
4
+
5
+ * Allow conversion to native Boolean from any Ruby value
6
+
7
+ ## 0.11.2 / 2017-04-20
4
8
 
5
9
  * Allow vfunc implementation using a regular method
6
10
 
@@ -16,7 +16,7 @@ module GirFFI
16
16
  end
17
17
 
18
18
  def self.to_native(value, _context)
19
- TO_NATIVE.fetch(value)
19
+ TO_NATIVE.fetch(value ? true : false)
20
20
  end
21
21
 
22
22
  def self.size
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Current GirFFI version
4
4
  module GirFFI
5
- VERSION = '0.11.2'.freeze
5
+ VERSION = '0.11.3'.freeze
6
6
  end
@@ -25,6 +25,14 @@ describe GirFFI::Boolean do
25
25
  it 'converts true to 1' do
26
26
  GirFFI::Boolean.to_native(true, 'whatever').must_equal 1
27
27
  end
28
+
29
+ it 'converts nil to 0' do
30
+ GirFFI::Boolean.to_native(nil, 'whatever').must_equal 0
31
+ end
32
+
33
+ it 'converts truthy value to 1' do
34
+ GirFFI::Boolean.to_native('i am truth!', 'whatever').must_equal 1
35
+ end
28
36
  end
29
37
 
30
38
  describe '.size' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gir_ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matijs van Zuijlen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-20 00:00:00.000000000 Z
11
+ date: 2017-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi