gir_ffi 0.12.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +80 -73
  3. data/Gemfile +2 -0
  4. data/README.md +2 -2
  5. data/lib/ffi-glib/array.rb +6 -6
  6. data/lib/ffi-glib/bytes.rb +5 -5
  7. data/lib/ffi-glib/container_class_methods.rb +6 -6
  8. data/lib/ffi-glib/error.rb +4 -4
  9. data/lib/ffi-glib/main_loop.rb +8 -8
  10. data/lib/ffi-glib/ptr_array.rb +2 -2
  11. data/lib/ffi-glib/strv.rb +5 -5
  12. data/lib/ffi-glib/variant.rb +3 -3
  13. data/lib/ffi-gobject.rb +1 -0
  14. data/lib/ffi-gobject/closure.rb +2 -2
  15. data/lib/ffi-gobject/object.rb +37 -15
  16. data/lib/ffi-gobject/value.rb +5 -5
  17. data/lib/ffi-gobject_introspection/i_registered_type_info.rb +1 -1
  18. data/lib/gir_ffi/builders/argument_builder.rb +1 -3
  19. data/lib/gir_ffi/builders/argument_builder_collection.rb +6 -6
  20. data/lib/gir_ffi/builders/c_to_ruby_convertor.rb +1 -5
  21. data/lib/gir_ffi/builders/callback_argument_builder.rb +2 -6
  22. data/lib/gir_ffi/builders/module_builder.rb +1 -3
  23. data/lib/gir_ffi/builders/null_class_builder.rb +2 -2
  24. data/lib/gir_ffi/builders/user_defined_builder.rb +7 -17
  25. data/lib/gir_ffi/builders/with_layout.rb +1 -1
  26. data/lib/gir_ffi/class_base.rb +4 -8
  27. data/lib/gir_ffi/enum_like_base.rb +2 -4
  28. data/lib/gir_ffi/instance_method_setup.rb +14 -0
  29. data/lib/gir_ffi/interface_base.rb +4 -8
  30. data/lib/gir_ffi/method_setup.rb +14 -0
  31. data/lib/gir_ffi/module_base.rb +4 -4
  32. data/lib/gir_ffi/object_base.rb +2 -2
  33. data/lib/gir_ffi/sized_array.rb +4 -3
  34. data/lib/gir_ffi/version.rb +1 -1
  35. data/tasks/test.rake +60 -60
  36. data/test/gir_ffi/builder_test.rb +1 -1
  37. data/test/integration/generated_regress_test.rb +1 -1
  38. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4542b1c76addaf7e01bb9a6c8d7107d86ea0de3e898db45ed0e36692dd04f62f
4
- data.tar.gz: 25a8bf9129747761c58a995b47bc2d191b7dba53b0a2e8009cbc2625335bc0fa
3
+ metadata.gz: 2772619a7c65c8eb17f50aa252f89620d8965474b8c6d27717187cbfc003201a
4
+ data.tar.gz: 317b202f4b97d93b4c12fa21ce22e7d1971e34ba10fd434ec9b6dcc4bf4bd214
5
5
  SHA512:
6
- metadata.gz: a32e266d808fc123545e1ad23fa21f68263b51e73c2d9c3b7d0343097492ab434c55417ec2415273229509c973865e47a7d8a70855c863b30b2ea652ee401004
7
- data.tar.gz: 96bf9543953553bb03ba2b087f970040e78e720b3608510e534354c1d74d11d86e08ef05cdd3f93b84d5342e19010455d9c3443ffe8dd0e04006658a5e2865ab
6
+ metadata.gz: 8bef86f44195465dae96b1b3adb36e21c92c88be7555732624c4819f3b99a48b2837fabcfec786f525d6dbf12694d76005a2ead9f4d350e5c84ac1e94374bc6d
7
+ data.tar.gz: bfdcfda1e4c237289887289dc51355ec1bce224ae126ec7b665e10c98dc18547a89e488c807025197291d8d76cd099d3c609872679ff74c6243f1e32a5881991
data/Changelog.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.0 / 2018-09-08
4
+
5
+ * Drop support for Ruby 2.1
6
+ * Support GLib 2.58
7
+ * Add `setup_method!` and `setup_instance_method!`, that raise an error when
8
+ the given method is not found.
9
+
3
10
  ## 0.12.1 / 2018-05-20
4
11
 
5
12
  * Restore support for Ruby 2.1 and 2.2
@@ -32,18 +39,18 @@
32
39
 
33
40
  * Internal test and code improvements. Some internal APIs have been removed or
34
41
  changed.
35
- * Make Strv#each thread-safe.
42
+ * Make `Strv#each` thread-safe.
36
43
  * Drop support for CRuby 2.0.
37
- * Move type_init and base Strv implementation into GObjectIntrospection, making
44
+ * Move `::type_init` and base `Strv` implementation into `GObjectIntrospection`, making
38
45
  it stand-alone.
39
- * Move GLib::Boolean to GirFFI::Boolean.
46
+ * Move `GLib::Boolean` to `GirFFI::Boolean`.
40
47
  * Guard against instantiating abstract classes using the default constructor.
41
48
  * Handle user-defined properties containing dashes
42
49
  * Handle user-defined properties of a large number of types
43
50
 
44
51
  ## 0.10.2 / 2016-04-29
45
52
 
46
- * Update ffi-bit_masks dependency and remove monkey-patch
53
+ * Update `ffi-bit_masks` dependency and remove monkey-patch
47
54
  * Support gobject-introspection version 1.48
48
55
 
49
56
  ## 0.10.1 / 2016-03-28
@@ -70,7 +77,7 @@
70
77
  * Remove unused classes and methods
71
78
  * Clearly distinguish boxed types from other structs
72
79
  * Take ownership transfer into account in generated methods
73
- * Properly free unions, structs and boxed types owned by gir_ffi
80
+ * Properly free unions, structs and boxed types owned by GirFFI
74
81
  * Block access to fields that have disguised types
75
82
 
76
83
  ## 0.9.5 / 2016-03-05
@@ -81,14 +88,14 @@
81
88
  * Allow getting and setting of properties with a callback value.
82
89
  * Handle pointer-like signal arguments such as GList.
83
90
  * Handle static methods on interface modules.
84
- * Free most self-allocated boxed types using GObject.boxed_free.
91
+ * Free most self-allocated boxed types using `GObject.boxed_free`.
85
92
  * Correctly assign length arguments for zero-terminated arguments
86
93
 
87
94
  ## 0.9.4 / 2016-02-22
88
95
 
89
96
  * Pass nil user data as null pointer, and store a missing callback as nil. This
90
97
  avoids passing a null callback and a non-null user data value, which causes
91
- problems with vte_terminal_spawn_sync() and perhaps other functions.
98
+ problems with `vte_terminal_spawn_sync()` and perhaps other functions.
92
99
 
93
100
  ## 0.9.3 / 2016-02-20
94
101
 
@@ -113,12 +120,12 @@
113
120
 
114
121
  * Propagate exceptions from callbacks during event loops
115
122
  * Make default object constructor take a hash of properties
116
- * Fix implementation of ObjectBase.object_class
123
+ * Fix implementation of `ObjectBase.object_class`
117
124
  * Make object class struct types inherit from their parent structs. This makes
118
125
  parent methods and fields available.
119
- * Use ObjectBase.object_class instead of old Object#type_class to find
126
+ * Use `ObjectBase.object_class` instead of old `Object#type_class` to find
120
127
  properties
121
- * Remove Object#type_class
128
+ * Remove `Object#type_class`
122
129
  * Automatically unpack GValue return values
123
130
  * Use a BitMask to handle flag values
124
131
  * Handle callback arguments as Ruby block arguments
@@ -137,18 +144,18 @@
137
144
  ## 0.8.5 / 2015-12-04
138
145
 
139
146
  * Improve GObject::Value
140
- * Make #wrap_ruby_value work for object classes
147
+ * Make `#wrap_ruby_value` work for object classes
141
148
  * Use non-deprecated methods for getting and setting char values
142
- * Make set_value and get_value work for interface types
149
+ * Make `set_value` and `get_value` work for interface types
143
150
 
144
151
  ## 0.8.4 / 2015-12-03
145
152
 
146
153
  * Handle classes with lower-case names
147
- * Make ObjectBase a DataConverter so FFI handles it natively
154
+ * Make `ObjectBase` a `DataConverter` so FFI handles it natively
148
155
  * Use more of gobject-introspection's test libraries for testing
149
156
  * Simplify constructor overrides: Custom initializers will no longer be
150
157
  overwritten when setting up the corresponding constructor.
151
- * Override GObject::Object.new to not require a GType argument
158
+ * Override `GObject::Object.new` to not require a GType argument
152
159
 
153
160
  ## 0.8.3 / 2015-11-13
154
161
 
@@ -158,18 +165,18 @@
158
165
  ## 0.8.2 / 2015-10-10
159
166
 
160
167
  * Use inherited constructor for boxed types
161
- * Make InOutPointer work correctly for boxed types
162
- * Make .for work with boxed types
163
- * Make #set_value work with boxed types
168
+ * Make `InOutPointer` work correctly for boxed types
169
+ * Make `.for` work with boxed types
170
+ * Make `#set_value` work with boxed types
164
171
  * Make GObject::Value support nil type:
165
- * Make .wrap_ruby_value(nil) work
166
- * Make #set_value and #get_value work when the type is TYPE_INVALID
167
- * Make .for_gtype work with TYPE_INVALID and TYPE_NONE
168
- * Make .from(nil) return a GObject::Value instead of nil
169
- * Make #set_ruby_value private
170
- * Make GObject::Object.signal_emit work with gobject-introspection 1.46
171
- * Replace or remove all custom .new methods
172
- * Make setup_method and setup_instance_method handle symbol arguments
172
+ * Make `.wrap_ruby_value(nil)` work
173
+ * Make `#set_value` and `#get_value` work when the type is `TYPE_INVALID`
174
+ * Make `.for_gtype` work with `TYPE_INVALID` and `TYPE_NONE`
175
+ * Make `.from(nil)` return a `GObject::Value` instead of nil
176
+ * Make `#set_ruby_value` private
177
+ * Make `GObject::Object.signal_emit` work with gobject-introspection 1.46
178
+ * Replace or remove all custom `.new` methods
179
+ * Make `setup_method` and `setup_instance_method` handle symbol arguments
173
180
 
174
181
  ## 0.8.1 / 2015-10-04
175
182
 
@@ -184,7 +191,7 @@
184
191
 
185
192
  ## 0.7.10 / 2015-09-16
186
193
 
187
- * Allow ffi-gobject and ffi-glib to be required directly
194
+ * Allow `ffi-gobject` and `ffi-glib` to be required directly
188
195
  * Improve documentation
189
196
  * Remove arbitrary refcount check from finalizer (by John Cupitt)
190
197
 
@@ -208,18 +215,18 @@
208
215
  * Support constants with a falsy value
209
216
  * Support type aliases that resolve to a type that is not introspectable
210
217
  * Support callback arguments with direction :inout
211
- * Provide GObject.signal_connect_after and GObject::Object.signal_connect_after
218
+ * Provide `GObject.signal_connect_after` and `GObject::Object.signal_connect_after`
212
219
  * Handle setting GValues (and hence, properties) that have enum values
213
220
  * Various refactorings & coding style cleanups
214
221
 
215
222
  ## 0.7.7 / 2014-10-21
216
223
 
217
224
  * Handle introspecting boolean constants
218
- * Provide config.h for versions of the test libs that need it
225
+ * Provide `config.h` for versions of the test libs that need it
219
226
  * Include gemspec in the gem
220
- * Avoid needless casting from string to symbol by making #setup_and_call take a
227
+ * Avoid needless casting from string to symbol by making `#setup_and_call` take a
221
228
  string
222
- * Avoid argument list unpacking by making #setup_and_call take an array of
229
+ * Avoid argument list unpacking by making `#setup_and_call` take an array of
223
230
  arguments rather than a variable number of arguments
224
231
  * Remove old example files
225
232
  * Let rubygems know about required Ruby version
@@ -227,16 +234,16 @@
227
234
 
228
235
  ## 0.7.6 / 2014-08-22
229
236
 
230
- * Work around respond_to? behavior in JRuby 1.6.13
231
- * Deprecate setup_class in favor of load_class
237
+ * Work around `respond_to?` behavior in JRuby 1.6.13
238
+ * Deprecate `setup_class` in favor of `load_class`
232
239
  * Support GValue containing GArray
233
- * Provide constant TYPE_BYTE_ARRAY
240
+ * Provide constant `TYPE_BYTE_ARRAY`
234
241
  * Don't recurse looking for signals and properties
235
242
  * Clean up generated code:
236
243
  * Avoid use of an ignored dummy argument
237
244
  * Clean up trailing whitespace
238
245
  * Drop support for Ruby 1.9.2
239
- * Allow data argument for GObject::Object#signal_connect
246
+ * Allow data argument for `GObject::Object#signal_connect`
240
247
  * Let Ruby threads run during GLib's main loop
241
248
  * Make all dependencies versioned
242
249
  * Various refactoring & code cleanup
@@ -269,18 +276,18 @@
269
276
 
270
277
  * Officially drop Ruby 1.8 compatibility.
271
278
  * Store GType of generated types in a constant, removing the need to generate a
272
- separate get_gtype method for each type.
279
+ separate `get_gtype` method for each type.
273
280
 
274
281
  ## 0.7.1 / 2014-01-17
275
282
 
276
- * Handle method setup for methods with unsafe names (i.e., g_iconv())
283
+ * Handle method setup for methods with unsafe names (i.e., `g_iconv()`)
277
284
  * Add override for GLib::IConv.open
278
285
 
279
286
  ## 0.7.0 / 2014-01-11
280
287
 
281
288
  * Type handling:
282
289
  * Handle c arrays with separate length argument for signals
283
- * Handle GHashTable values of type :gint8 and :guint32
290
+ * Handle GHashTable values of type `:gint8` and `:guint32`
284
291
  * Handle signals with int64, Strv, uint64 arguments
285
292
  * Handle arrays of integers cast as pointers
286
293
  * Handle fields of callback type
@@ -299,11 +306,11 @@
299
306
  * Support adding an interface to a subclass
300
307
  * Support implementing an interface's virtual functions in a subclass
301
308
  * Use FFI's DataConvertor system to handle enums and callbacks
302
- * Stop using deprecated GValueArray to construct argument array for signal_emit
303
- * Make ITypeInfo#g_type return correct value for c arrays
304
- * Make get_property and set_property less smart, moving conversion into the
309
+ * Stop using deprecated GValueArray to construct argument array for `signal_emit`
310
+ * Make `ITypeInfo#g_type` return correct value for c arrays
311
+ * Make `get_property` and `set_property` less smart, moving conversion into the
305
312
  property accessor definitions
306
- * Make GObject::Value#get_value handle enums and flags
313
+ * Make `GObject::Value#get_value` handle enums and flags
307
314
  * Clean up deprecated methods
308
315
 
309
316
  ## 0.6.7 / 2013-09-28
@@ -333,19 +340,19 @@
333
340
 
334
341
  ## 0.6.4 / 2013-06-30
335
342
 
336
- * Represent enum types by modules wrapping FFI::Enum
343
+ * Represent enum types by modules wrapping `FFI::Enum`
337
344
  * Support functions on enums
338
345
  * Handle zero-terminated arrays of types other than int32
339
- * Add override for GLib::Variant#get_string
346
+ * Add override for `GLib::Variant#get_string`
340
347
  * Handle non-throwing arguments and return values of type GError
341
348
  * Handle arguments and return values of type GPtrArray
342
349
  * Handle caller-allocated arguments of type GArray
343
- * Deprecate GObject::Value#ruby_value, replacing it with #get_value
350
+ * Deprecate `GObject::Value#ruby_value`, replacing it with `#get_value`
344
351
 
345
352
  ## 0.6.3 / 2013-06-15
346
353
 
347
354
  * Make use of enums as element type for GHashTable and other containers
348
- work
355
+ work
349
356
 
350
357
  ## 0.6.2 / 2013-06-14
351
358
 
@@ -362,15 +369,15 @@ work
362
369
 
363
370
  ## 0.5.2 / 2013-04-23
364
371
 
365
- * Handle signal details in GObject.signal_connect and .signal_emit
366
- * Make GValue#set_value check object GType compatibility
372
+ * Handle signal details in `GObject.signal_connect` and `.signal_emit`
373
+ * Make `GValue#set_value` check object GType compatibility
367
374
  * Eliminate GObject::Helper module
368
375
  * Handle more argument types
369
376
  * Support Ruby 2.0.0
370
377
 
371
378
  ## 0.5.1 / 2013-02-01
372
379
 
373
- * Properly handle zero-terminated arrays of :filename
380
+ * Properly handle zero-terminated arrays of `:filename`
374
381
  * Loosen dependencies on ffi and minitest
375
382
 
376
383
  ## 0.5.0 / 2013-01-19
@@ -401,7 +408,7 @@ their GType.
401
408
 
402
409
  ## 0.4.0 / 2012-08-24
403
410
 
404
- * Move Gtk+ bindings to their own gem (gir_ffi-gtk).
411
+ * Move Gtk+ bindings to their own gem (`gir_ffi-gtk`).
405
412
 
406
413
  ## 0.3.2 / 2012-08-24
407
414
 
@@ -419,12 +426,12 @@ incomplete type specification.
419
426
  * Make classes created by the Unintrospectable builder know their GType.
420
427
  * Create property accessors instead of field accessors for GObjects.
421
428
  * Add Ruby-style getter and setter methods (by Antonio Terceiro).
422
- * Add #signal_connect instance method (by Antonio Terceiro).
429
+ * Add `#signal_connect` instance method (by Antonio Terceiro).
423
430
  * Make GirFFI's tests pass with gobject-introspection 0.10.
424
431
  * Improve unintrospectable type handling.
425
432
  * Bug fixes and refactorings.
426
- * Start implementing #define_type, for creating descendent types that
427
- the GObject system knows about.
433
+ * Start implementing `#define_type`, for creating descendent types that
434
+ the GObject system knows about.
428
435
 
429
436
  ## 0.2.3 / 2011-12-31
430
437
 
@@ -442,18 +449,18 @@ errors.
442
449
  ## 0.2.1 / 2011-11-20
443
450
 
444
451
  * Fix handling of output parameters that are arrays of pointers to
445
- structures (i.e., of type Foo***).
452
+ structures (i.e., of type `Foo***`).
446
453
 
447
454
  ## 0.2.0 / 2011-11-19
448
455
 
449
- * Add support for properties, with #get_property and #set_property.
456
+ * Add support for properties, with `#get_property` and `#set_property`.
450
457
  * Add support for fields.
451
- - Create field accessor methods.
452
- - Get rid of #[] and #[]=.
453
- * Explicitely load libgirepository with ABI version 1.
458
+ - Create field accessor methods.
459
+ - Get rid of `#[]` and `#[]=`.
460
+ * Explicitely load `libgirepository` with ABI version 1.
454
461
  * Improve implementation of GLib container classes (GList etc.):
455
462
  - Real constructors.
456
- - #append and friends are instance methods now.
463
+ - `#append` and friends are instance methods now.
457
464
  - Conversion methods to cast Ruby containers to GLib containers.
458
465
  * Start implementing pretty printing.
459
466
  * Various refactorings.
@@ -461,21 +468,21 @@ structures (i.e., of type Foo***).
461
468
  ## 0.1.0 / 2011-10-28
462
469
 
463
470
  * Put bindings for GObjectIntrospection in their own namespace.
464
- * GirFFI.setup no longer loads overrides.
465
- * Add ffi-gtk2 and ffi-gtk3 files for loading Gtk+ overrides.
471
+ * `GirFFI.setup` no longer loads overrides.
472
+ * Add `ffi-gtk2` and `ffi-gtk3` files for loading Gtk+ overrides.
466
473
 
467
474
  ## 0.0.14 / 2011-10-28
468
475
 
469
476
  * Support GObject Introspection version 1.30:
470
477
  - Add support for layouts with fixed-length arrays.
471
478
  - Handle type names starting with underscores.
472
- - Call g_signal_emitv directly to avoid conflict in introspection info
479
+ - Call `g_signal_emitv` directly to avoid conflict in introspection info
473
480
  with earlier versions of GObject Introspection.
474
481
 
475
482
  ## 0.0.13 / 2011-09-09
476
483
 
477
484
  * Remove IErrorDomain related code. This functinality was removed from
478
- GObject Introspection in version 1.29.17
485
+ GObject Introspection in version 1.29.17
479
486
 
480
487
  ## 0.0.12 / 2011-09-04
481
488
 
@@ -485,9 +492,9 @@ GObject Introspection in version 1.29.17
485
492
  ## 0.0.11 / 2011-08-22
486
493
 
487
494
  * Change interface to the underlying builder in generated modules and
488
- classes.
495
+ classes.
489
496
  * Handle string, enum, union, flags signal arguments.
490
- * Handle string arguments in GObject.signal_emit.
497
+ * Handle string arguments in `GObject.signal_emit`.
491
498
  * Handle enum signal arguments.
492
499
  * Fix finding signals in non-introspectable types.
493
500
  * Fix method setup in non-introspectable types.
@@ -513,22 +520,22 @@ classes.
513
520
  ## 0.0.8 / 2011-04-08
514
521
 
515
522
  * Generate modules with names starting with a lowercase letter (like
516
- cairo).
523
+ `cairo`).
517
524
  * Allow specifying the typelib version on setup.
518
- * Rename methods #methods and #type of the introspection classes to avoid
519
- clashing with standard Ruby methods.
525
+ * Rename methods `#methods` and `#type` of the introspection classes to avoid
526
+ clashing with standard Ruby methods.
520
527
  * Refactoring.
521
528
 
522
529
  ## 0.0.7 / 2011-04-01
523
530
 
524
531
  * Support gobject-introspection 0.10, drop support for earlier versions.
525
- - Use Regress, not Everything, for testing.
526
- - Deal with functions that are no longer introspectable.
532
+ - Use Regress, not Everything, for testing.
533
+ - Deal with functions that are no longer introspectable.
527
534
  * Correctly handle constructors that declare their return type different
528
- from their class.
529
- * Implement RubyClosure, a GObject::Closure for handling ruby callbacks.
535
+ from their class.
536
+ * Implement `RubyClosure`, a `GObject::Closure` for handling ruby callbacks.
530
537
  * Handle GLib's singly and doubly linked lists.
531
- * Handle callback types defined in-place (like Closure's marshal).
538
+ * Handle callback types defined in-place (like `Closure`'s `marshal`).
532
539
  * Refactoring.
533
540
 
534
541
  ## 0.0.6 / 2011-03-01
@@ -554,7 +561,7 @@ from their class.
554
561
  * Handle out-only arguments.
555
562
  * Make use of callbacks from other namespaces work.
556
563
  * Handle virtual methods where the invoker method has a different name.
557
- * Implement usable signal_connect and signal_emit.
564
+ * Implement usable `signal_connect` and `signal_emit`.
558
565
  * Sink floating references when creating a GObject.
559
566
  * Implement Union type.
560
567
  * Many small bug fixes.
data/Gemfile CHANGED
@@ -5,6 +5,8 @@ source 'https://rubygems.org'
5
5
  # The gem's dependencies are specified in gir_ffi.gemspec
6
6
  gemspec
7
7
 
8
+ gem 'pry', '~> 0.11.0'
9
+
8
10
  if ENV['CI']
9
11
  gem 'coveralls', group: :development if ENV['TRAVIS_RUBY_VERSION'] == '2.4'
10
12
  end
data/README.md CHANGED
@@ -53,7 +53,7 @@ examples can be found in `gir_ffi-gtk` and `gir_ffi-gst`.
53
53
 
54
54
  ## Requirements
55
55
 
56
- GirFFI is supported on CRuby 2.3, 2.4 and 2.5, and JRuby 9.1.
56
+ GirFFI is supported on CRuby 2.2, 2.3, 2.4 and 2.5, and JRuby 9.1 and 9.2
57
57
 
58
58
  You will also need gobject-introspection installed with some
59
59
  introspection data.
@@ -119,7 +119,7 @@ The following people have contributed to GirFFI over the years:
119
119
 
120
120
  ## License
121
121
 
122
- Copyright © 2009–2016 [Matijs van Zuijlen](http://www.matijs.net)
122
+ Copyright © 2009–2018 [Matijs van Zuijlen](http://www.matijs.net)
123
123
 
124
124
  GirFFI is free software, distributed under the terms of the GNU Lesser
125
125
  General Public License, version 2.1 or later. See the file COPYING.LIB for
@@ -22,8 +22,8 @@ module GLib
22
22
  end
23
23
 
24
24
  # @api private
25
- def self.from_enumerable(elmtype, it)
26
- new(elmtype).tap { |arr| arr.append_vals it }
25
+ def self.from_enumerable(elmtype, arr)
26
+ new(elmtype).tap { |it| it.append_vals arr }
27
27
  end
28
28
 
29
29
  # @api private
@@ -53,7 +53,7 @@ module GLib
53
53
  Lib.g_array_get_element_size self
54
54
  end
55
55
 
56
- alias_method :element_size, :get_element_size
56
+ alias element_size get_element_size
57
57
 
58
58
  def ==(other)
59
59
  to_a == other.to_a
@@ -81,9 +81,9 @@ module GLib
81
81
  end
82
82
 
83
83
  def check_element_size_match
84
- unless calculated_element_size == get_element_size
85
- warn 'WARNING: Element sizes do not match'
86
- end
84
+ return if calculated_element_size == get_element_size
85
+
86
+ warn 'WARNING: Element sizes do not match'
87
87
  end
88
88
 
89
89
  def guess_element_type