gir_ffi 0.15.7 → 0.15.8

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
  SHA256:
3
- metadata.gz: ce8934650d918851ad4a5eee0c37f66025c0c5292aa7f556494998741f415de8
4
- data.tar.gz: dd13f22a5ca8a3f9d3783827152b402a70f4b096a1443658c967254387bd4379
3
+ metadata.gz: b7c0566bc2fcd7e7b5ab1381448f4738fdebd617743c524ea18c343e1d3fbce5
4
+ data.tar.gz: 5008632e7cd2fa2190c12f056257f68a94b03fa4a8f225df54fae006b6127db1
5
5
  SHA512:
6
- metadata.gz: 6fc02f1d258f98957da87ad2573db3c5300c5652e58cff69cf82ad00c8dcdf410cbad257a2def7c8b2803dc23caa96a33e0178e57f9a123d4f2b79410ff6ec8e
7
- data.tar.gz: ba8168148f9a8d3cab2d462096734596d8785e5bb2531b825e38073cbda750d5504fb2b0ec3fa191debad560da98b8d2ca9d8c09836481bfb078ebaf149f1649
6
+ metadata.gz: 7a0f1e2330171a92b26a1c476e0c5b7beaeb2e38e6e0e81d9bb47247b74b02ed7e0e5261c2e7adf33f93860b284e2eddf61a938c584c5cccaab69b2b85d5109c
7
+ data.tar.gz: ddb889010ccc55495ffb306e3996fa6ce37367bbc65ff78f0024df244b3663691879be7f78c53c9543f90b4360dfca35b47bf35a9acf7382271a685aea542cbe
data/Changelog.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.15.8 / 2021-11-20
4
+
5
+ * Drop support for Ruby 2.5
6
+ * Bump minimum supported version of gobject-introspection to 1.56.0
7
+ * Bump minimum supported version of glib to 2.56.0
8
+ * Handle functions that have swapped closure annotation
9
+ * Handle GPtrArray arguments in signal handlers
10
+
3
11
  ## 0.15.7 / 2021-01-15
4
12
 
5
13
  * Handle sized arrays with interface element types
data/README.md CHANGED
@@ -9,10 +9,9 @@ Ruby bindings for GNOME using the GObject Introspection Repository.
9
9
  ## Status
10
10
 
11
11
  [![Gem Version](https://badge.fury.io/rb/gir_ffi.svg)](http://badge.fury.io/rb/gir_ffi)
12
- [![Depfu](https://badges.depfu.com/badges/d5a8e9bffd2462a7ab4921d2f7e6fc48/overview.svg)](https://depfu.com/github/mvz/gir_ffi)
13
- [![Build Status](https://travis-ci.org/mvz/gir_ffi.svg?branch=master)](https://travis-ci.org/mvz/gir_ffi)
12
+ [![Build Status](https://github.com/mvz/gir_ffi/actions/workflows/ruby.yml/badge.svg)](https://github.com/mvz/gir_ffi/actions/workflows/ruby.yml)
14
13
  [![Code Climate](https://codeclimate.com/github/mvz/gir_ffi/badges/gpa.svg)](https://codeclimate.com/github/mvz/gir_ffi)
15
- [![Documentation Status](https://inch-ci.org/github/mvz/gir_ffi.svg?branch=master)](https://inch-ci.org/github/mvz/gir_ffi/branch/master)
14
+ [![Documentation Status](https://inch-ci.org/github/mvz/gir_ffi.svg?branch=master)](https://inch-ci.org/github/mvz/gir_ffi)
16
15
 
17
16
  ## Features
18
17
 
@@ -52,7 +51,7 @@ examples can be found in `gir_ffi-gtk` and `gir_ffi-gst`.
52
51
 
53
52
  ## Requirements
54
53
 
55
- GirFFI is supported on CRuby 2.5, 2.6, 2.7 and 3.0, and JRuby 9.2.
54
+ GirFFI is supported on CRuby 2.6, 2.7 and 3.0, and JRuby 9.3.
56
55
 
57
56
  You will also need gobject-introspection installed with some
58
57
  introspection data.
@@ -62,7 +61,8 @@ available under the name ending in plain `.so`. If GirFFI complains that it
62
61
  cannot find the library, try installing development packages for those
63
62
  libraries.
64
63
 
65
- GirFFI should work with gobject-introspection 1.46.0 and up.
64
+ GirFFI should work with gobject-introspection 1.56.0 and up, and glib 2.56.0
65
+ and up.
66
66
 
67
67
  On Debian and Ubuntu, installing `libgirepository-1.0-1` and `gir1.2-glib-2.0`
68
68
  should be enough to use GirFFI in your application.
@@ -89,24 +89,9 @@ already exist:
89
89
  * `gir_ffi-tracker`: overrides for Tracker
90
90
  * `gir_ffi-gst`: overrides for GStreamer
91
91
 
92
- ## Hacking and contributing
92
+ ## Contributing
93
93
 
94
- Please feel free to file bugs or send pull requests!
95
-
96
- If you just want to help out but don't know where to start, have a look at
97
- TODO.md, and check the notes in the code (e.g., using `dnote`).
98
-
99
- If you want to send pull requests or patches, try to follow the instructions
100
- below. **If you get stuck, please make a pull request anyway and I'll try to
101
- help out.**
102
-
103
- * Make sure `rake test` runs without reporting any failures.
104
- * Add tests for your feature. Otherwise, I can't see if it works or if I
105
- break it later.
106
- * Make sure latest master merges cleanly with your branch. Things might
107
- have moved around since you forked.
108
- * Try not to include changes that are irrelevant to your feature in the
109
- same commit.
94
+ Please see [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
110
95
 
111
96
  ## Contributors
112
97
 
@@ -119,7 +104,7 @@ The following people have contributed to GirFFI over the years:
119
104
 
120
105
  ## License
121
106
 
122
- Copyright © 2009–2020 [Matijs van Zuijlen](http://www.matijs.net)
107
+ Copyright © 2009–2021 [Matijs van Zuijlen](http://www.matijs.net)
123
108
 
124
109
  GirFFI is free software, distributed under the terms of the GNU Lesser
125
110
  General Public License, version 2.1 or later. See the file COPYING.LIB for
@@ -39,7 +39,7 @@ module GLib
39
39
  end
40
40
 
41
41
  def to_hash
42
- Hash[to_a]
42
+ to_a.to_h
43
43
  end
44
44
 
45
45
  # @override
@@ -7,60 +7,40 @@ GObject.load_class :Object
7
7
  module GObject
8
8
  # Overrides for GObject, GObject's generic base class.
9
9
  class Object
10
- if GLib.check_version(2, 54, 0)
11
- setup_method! "new"
12
-
13
- # Before GLib 2.54.0, use g_object_newv, which takes an array of GParameter.
14
- def initialize_with_automatic_gtype(properties = {})
15
- gparameters = properties.map do |name, value|
16
- name = name.to_s
17
- property_param_spec(name)
18
- GObject::Parameter.new.tap do |gparam|
19
- gparam.name = name
20
- gparam.value = value
21
- end
22
- end
23
- initialize_without_automatic_gtype(self.class.gtype, gparameters)
24
- end
25
-
26
- alias initialize_without_automatic_gtype initialize
27
- alias initialize initialize_with_automatic_gtype
28
- else
29
- GObject::Lib.attach_function(:g_object_new_with_properties,
30
- [:size_t, :uint32, :pointer, :pointer],
31
- :pointer)
32
-
33
- def self.new_with_properties(*args, &block)
34
- obj = allocate
35
- obj.__send__ :initialize_with_properties, *args, &block
36
- obj
37
- end
10
+ GObject::Lib.attach_function(:g_object_new_with_properties,
11
+ [:size_t, :uint32, :pointer, :pointer],
12
+ :pointer)
13
+
14
+ def self.new_with_properties(*args, &block)
15
+ obj = allocate
16
+ obj.__send__ :initialize_with_properties, *args, &block
17
+ obj
18
+ end
38
19
 
39
- # Starting with GLib 2.54.0, use g_object_new_with_properties, which
40
- # takes an array of names and an array of values.
41
- def initialize_with_properties(properties = {})
42
- names, gvalues = names_and_gvalues_for_properties(properties)
20
+ # Starting with GLib 2.54.0, use g_object_new_with_properties, which
21
+ # takes an array of names and an array of values.
22
+ def initialize_with_properties(properties = {})
23
+ names, gvalues = names_and_gvalues_for_properties(properties)
43
24
 
44
- n_properties = names.length
45
- names_arr = GirFFI::SizedArray.from(:utf8, -1, names)
46
- gvalues_arr = GirFFI::SizedArray.from(GObject::Value, -1, gvalues)
25
+ n_properties = names.length
26
+ names_arr = GirFFI::SizedArray.from(:utf8, -1, names)
27
+ gvalues_arr = GirFFI::SizedArray.from(GObject::Value, -1, gvalues)
47
28
 
48
- ptr = GObject::Lib.g_object_new_with_properties(self.class.gtype,
49
- n_properties,
50
- names_arr,
51
- gvalues_arr)
52
- store_pointer ptr
53
- end
29
+ ptr = GObject::Lib.g_object_new_with_properties(self.class.gtype,
30
+ n_properties,
31
+ names_arr,
32
+ gvalues_arr)
33
+ store_pointer ptr
34
+ end
54
35
 
55
- alias old_initialze initialize
56
- alias initialize initialize_with_properties
57
- remove_method :old_initialze
36
+ alias old_initialze initialize
37
+ alias initialize initialize_with_properties
38
+ remove_method :old_initialze
58
39
 
59
- def self.new(*args, &block)
60
- obj = allocate
61
- obj.__send__ :initialize, *args, &block
62
- obj
63
- end
40
+ def self.new(*args, &block)
41
+ obj = allocate
42
+ obj.__send__ :initialize, *args, &block
43
+ obj
64
44
  end
65
45
 
66
46
  alias base_initialize initialize
data/lib/ffi-gobject.rb CHANGED
@@ -69,7 +69,7 @@ module GObject
69
69
  sig_info = object.class.find_signal signal_name
70
70
 
71
71
  closure = sig_info.wrap_in_closure do |*args|
72
- block.call(*args << data)
72
+ yield(*args << data)
73
73
  end
74
74
 
75
75
  signal_connect_closure object, detailed_signal, closure, after
@@ -49,7 +49,7 @@ module GObjectIntrospection
49
49
  method = method.to_s
50
50
  cache_ivar = "@#{method}_cache"
51
51
  single ||= method[0..-2]
52
- count = method.sub(/^(get_)?/, '\\1n_')
52
+ count = method.sub(/^(get_)?/, "\\1n_")
53
53
  class_eval <<-CODE, __FILE__, __LINE__ + 1
54
54
  def #{method} # def fields
55
55
  #{cache_ivar} ||= # @fields_cache ||=
@@ -75,7 +75,11 @@ module GirFFI
75
75
  def set_up_user_data_relations
76
76
  @base_argument_builders.each do |bldr|
77
77
  if (idx = bldr.closure_idx) >= 0
78
- @base_argument_builders[idx].mark_as_user_data bldr
78
+ target_bldr = @base_argument_builders[idx]
79
+ unless target_bldr.specialized_type_tag == :void
80
+ target_bldr, bldr = bldr, target_bldr
81
+ end
82
+ target_bldr.mark_as_user_data bldr
79
83
  end
80
84
  end
81
85
  end
@@ -89,7 +89,7 @@ module GirFFI
89
89
  lib.extend FFI::BitMasks
90
90
  lib.ffi_lib_flags :global, :lazy
91
91
  if shared_library_specification
92
- lib.ffi_lib(*shared_library_specification.split(/,/))
92
+ lib.ffi_lib(*shared_library_specification.split(","))
93
93
  end
94
94
  end
95
95
 
data/lib/gir_ffi/core.rb CHANGED
@@ -42,7 +42,7 @@ module GirFFI
42
42
 
43
43
  if block_given?
44
44
  warn "Using define_type with a block is deprecated." \
45
- " Call the relevant functions inside the class definition instead."
45
+ " Call the relevant functions inside the class definition instead."
46
46
  yield info
47
47
  end
48
48
  Builders::UserDefinedBuilder.new(info).build_class
@@ -166,7 +166,8 @@ module GirFFI
166
166
  end
167
167
 
168
168
  def needs_c_to_ruby_conversion_for_closures?
169
- [:array, :c, :error, :ghash, :glist, :struct, :strv].include?(flattened_tag)
169
+ [:array, :c, :error, :ghash, :glist, :ptr_array, :struct, :strv]
170
+ .include?(flattened_tag)
170
171
  end
171
172
 
172
173
  def needs_ruby_to_c_conversion_for_closures?
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Current GirFFI version
4
4
  module GirFFI
5
- VERSION = "0.15.7"
5
+ VERSION = "0.15.8"
6
6
  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.15.7
4
+ version: 0.15.8
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: 2021-01-15 00:00:00.000000000 Z
11
+ date: 2021-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.0.0
47
+ version: 2.0.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.0.0
54
+ version: 2.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: minitest
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '5.12'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest-focus
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.3.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.3.1
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rake
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -128,28 +142,28 @@ dependencies:
128
142
  requirements:
129
143
  - - "~>"
130
144
  - !ruby/object:Gem::Version
131
- version: 1.8.0
145
+ version: 1.23.0
132
146
  type: :development
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
150
  - - "~>"
137
151
  - !ruby/object:Gem::Version
138
- version: 1.8.0
152
+ version: 1.23.0
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: rubocop-minitest
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
157
  - - "~>"
144
158
  - !ruby/object:Gem::Version
145
- version: 0.10.1
159
+ version: 0.16.0
146
160
  type: :development
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
164
  - - "~>"
151
165
  - !ruby/object:Gem::Version
152
- version: 0.10.1
166
+ version: 0.16.0
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: rubocop-packaging
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +184,14 @@ dependencies:
170
184
  requirements:
171
185
  - - "~>"
172
186
  - !ruby/object:Gem::Version
173
- version: 1.9.0
187
+ version: 1.12.0
174
188
  type: :development
175
189
  prerelease: false
176
190
  version_requirements: !ruby/object:Gem::Requirement
177
191
  requirements:
178
192
  - - "~>"
179
193
  - !ruby/object:Gem::Version
180
- version: 1.9.0
194
+ version: 1.12.0
181
195
  - !ruby/object:Gem::Dependency
182
196
  name: simplecov
183
197
  requirement: !ruby/object:Gem::Requirement
@@ -396,6 +410,7 @@ metadata:
396
410
  homepage_uri: http://www.github.com/mvz/ruby-gir-ffi
397
411
  source_code_uri: https://github.com/mvz/gir_ffi
398
412
  changelog_uri: https://github.com/mvz/gir_ffi/blob/master/Changelog.md
413
+ rubygems_mfa_required: 'true'
399
414
  post_install_message:
400
415
  rdoc_options:
401
416
  - "--main"
@@ -406,14 +421,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
406
421
  requirements:
407
422
  - - ">="
408
423
  - !ruby/object:Gem::Version
409
- version: 2.5.0
424
+ version: 2.6.0
410
425
  required_rubygems_version: !ruby/object:Gem::Requirement
411
426
  requirements:
412
427
  - - ">="
413
428
  - !ruby/object:Gem::Version
414
429
  version: '0'
415
430
  requirements: []
416
- rubygems_version: 3.2.3
431
+ rubygems_version: 3.2.22
417
432
  signing_key:
418
433
  specification_version: 4
419
434
  summary: FFI-based GObject binding using the GObject Introspection Repository