gir_ffi 0.9.1 → 0.9.2

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: a091e4dbd8360e158b2fb09d53f34fa6913dda07
4
- data.tar.gz: 98c7a541d76f2e6217dca26d8cfd2ed5d7b32c71
3
+ metadata.gz: ca3636ea5b78e4f09c583690ad160c4a2e739cb1
4
+ data.tar.gz: 8a4d243567cc87cc00d18783931c97a35635c6c1
5
5
  SHA512:
6
- metadata.gz: 1aaf7d901357faa26299c194deedb7a6cd42dafd62bb50e5f30c0c364ce4ef25349381deac8a4da8e42aa0d26d6d6bb2f0d1019884bf9c92a55fa03770df6485
7
- data.tar.gz: cfd6c0d21b4f674c1fd637f4d8d963158f29264e046204021fb539594a1015f0807c279047c998b71fca4bc8f53ca2d750edd433af3800fab01e6727ec548ccd
6
+ metadata.gz: 6994483aa5dd9df51ef778c97de12698abf57fa436527370c404e7e53e711f5febbe56bd34d1765e2efed09622d81ffbb3da8bb45d3b68048956a61d45562d68
7
+ data.tar.gz: 0092e6fb91d2cfa3e1f6f70e4d601b8a1ac617d817675f3c1ad5930c0b3e0989c5b93a3b56601b2e6f1939c15cb1016485baff82635781af01e5099936232df8
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.2 / 2016-02-05
4
+
5
+ * Do not create a property accessor when a corresponding getter method exists
6
+
3
7
  ## 0.9.1 / 2016-02-04
4
8
 
5
9
  * Add field accessors for Object types for fields that don't have corresponding
@@ -45,6 +45,12 @@ module GirFFI
45
45
  end
46
46
  end
47
47
 
48
+ def eligible_properties
49
+ info.properties.reject do |pinfo|
50
+ info.find_instance_method("get_#{pinfo.name}")
51
+ end
52
+ end
53
+
48
54
  protected
49
55
 
50
56
  def object_class_struct_info
@@ -102,7 +108,7 @@ module GirFFI
102
108
  end
103
109
 
104
110
  def setup_property_accessors
105
- info.properties.each do |prop|
111
+ eligible_properties.each do |prop|
106
112
  PropertyBuilder.new(prop).build
107
113
  end
108
114
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  # Current GirFFI version
3
3
  module GirFFI
4
- VERSION = '0.9.1'.freeze
4
+ VERSION = '0.9.2'.freeze
5
5
  end
@@ -99,4 +99,21 @@ describe GirFFI::Builders::ObjectBuilder do
99
99
  result.map(&:name).wont_include 'parent_instance'
100
100
  end
101
101
  end
102
+
103
+ describe '#eligible_properties' do
104
+ let(:wi_builder) do
105
+ GirFFI::Builders::ObjectBuilder.new(
106
+ get_introspection_data('Regress', 'TestWi8021x'))
107
+ end
108
+
109
+ it 'includes properties that do not have a matching getter method' do
110
+ result = obj_builder.eligible_properties
111
+ result.map(&:name).must_include 'double'
112
+ end
113
+
114
+ it 'skips properties that have a matching getter method' do
115
+ result = wi_builder.eligible_properties
116
+ result.map(&:name).wont_include 'testbool'
117
+ end
118
+ end
102
119
  end
@@ -14,5 +14,18 @@ describe 'the generated Gst module' do
14
14
  GObject.signal_emit(instance, 'handoff')
15
15
  a.must_equal 10
16
16
  end
17
+
18
+ it 'correctly fetches the name' do
19
+ instance.name.must_equal 'sink'
20
+ end
21
+ end
22
+
23
+ describe 'Gst::AutoAudioSink' do
24
+ let(:instance) { Gst::ElementFactory.make('autoaudiosink', 'audiosink') }
25
+
26
+ it 'correctly fetches the name' do
27
+ instance.get_name.must_equal 'audiosink'
28
+ instance.name.must_equal 'audiosink'
29
+ end
17
30
  end
18
31
  end
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.9.1
4
+ version: 0.9.2
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: 2016-02-04 00:00:00.000000000 Z
11
+ date: 2016-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi