gir_ffi 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.5.1 / 2013-02-01
2
+
3
+ * Properly handle zero-terminated arrays of :filename
4
+ * Loosen dependencies on ffi and minitest
5
+
1
6
  == 0.5.0 / 2013-01-19
2
7
 
3
8
  * Update ffi dependency
@@ -80,7 +80,7 @@ module GirFFI
80
80
  else
81
81
  tag.inspect
82
82
  end
83
- if type.pointer? && tag != :utf8
83
+ if type.pointer? && tag != :utf8 && tag != :filename
84
84
  "[:pointer, #{base}]"
85
85
  else
86
86
  base
@@ -90,7 +90,8 @@ module GirFFI
90
90
  private
91
91
 
92
92
  def zero_terminated_array_type
93
- if element_type == :utf8
93
+ case element_type
94
+ when :utf8, :filename
94
95
  :strv
95
96
  else
96
97
  # TODO: Check that array_type == :c
@@ -1,4 +1,4 @@
1
1
  module GirFFI
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
4
4
 
@@ -87,6 +87,20 @@ describe GirFFI::InfoExt::ITypeInfo do
87
87
  end
88
88
  end
89
89
 
90
+ describe "for a zero-terminated filename array" do
91
+ it "returns the pair [:strv, :filename]" do
92
+ stub(elmtype_info).tag { :filename }
93
+ stub(elmtype_info).pointer? { true }
94
+
95
+ stub(type_info).tag { :array }
96
+ stub(type_info).param_type(0) { elmtype_info }
97
+ stub(type_info).zero_terminated? { true }
98
+ stub(type_info).array_type { :c }
99
+
100
+ type_info.type_specification.must_equal "[:strv, :filename]"
101
+ end
102
+ end
103
+
90
104
  describe "for a zero-terminated array" do
91
105
  it "returns the pair [:zero_terminated, element_type]" do
92
106
  stub(elmtype_info).tag { :foo }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gir_ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-19 00:00:00.000000000 Z
12
+ date: 2013-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.2.0
21
+ version: '1.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 1.2.0
29
+ version: '1.2'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: indentation
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 4.3.3
53
+ version: '4.3'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 4.3.3
61
+ version: '4.3'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: rr
64
64
  requirement: !ruby/object:Gem::Requirement