glib2 4.1.0 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/glib2/rbglib.h +1 -1
- data/ext/glib2/rbgobj_boxed.c +15 -4
- data/ext/glib2/rbgobj_object.c +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 399d490f71821b01cb23b8bf9055dd4d432d66eb52a85a6e87339ba4ca30d85e
|
4
|
+
data.tar.gz: 572a338214811971c2d0311c76f46735135094b07205e4b5f593dc04ec2ac32c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43864daaf3a242bbd54ad1d322b5bae0288aa462fd425f6583935efc13378cf6d97e8ed7af03a8b52c2ef9907065e43ec1cfa28adbd0040fd0f16d132e390a75
|
7
|
+
data.tar.gz: f97c06d6b9ebdcca39919602afcf62fc9df7223fa60370b535d98641d6dca909f08ea91d2e0447df95e4064103d267e2fc728d8f9eb73188a1c0c181c2363de4
|
data/ext/glib2/rbglib.h
CHANGED
data/ext/glib2/rbgobj_boxed.c
CHANGED
@@ -180,15 +180,26 @@ rbgobj_boxed_initialize(VALUE obj, gpointer boxed)
|
|
180
180
|
gpointer
|
181
181
|
rbgobj_boxed_get_default(VALUE obj, GType gtype)
|
182
182
|
{
|
183
|
-
|
184
|
-
|
185
|
-
if (!RVAL2CBOOL(rb_obj_is_kind_of(obj,
|
183
|
+
VALUE klass = GTYPE2CLASS(gtype);
|
184
|
+
|
185
|
+
if (!RVAL2CBOOL(rb_obj_is_kind_of(obj, klass))) {
|
186
|
+
ID id_try_convert;
|
187
|
+
CONST_ID(id_try_convert, "try_convert");
|
188
|
+
if (rb_respond_to(klass, id_try_convert)) {
|
189
|
+
VALUE converted_obj = rb_funcall(klass, id_try_convert, 1, obj);
|
190
|
+
if (!NIL_P(converted_obj)) {
|
191
|
+
obj = converted_obj;
|
192
|
+
}
|
193
|
+
}
|
194
|
+
}
|
195
|
+
if (!RVAL2CBOOL(rb_obj_is_kind_of(obj, klass))) {
|
186
196
|
rb_raise(rb_eArgError,
|
187
197
|
"invalid argument %" PRIsVALUE " (expect %" PRIsVALUE ")",
|
188
198
|
CLASS_OF(obj),
|
189
199
|
GTYPE2CLASS(gtype));
|
200
|
+
}
|
190
201
|
|
191
|
-
holder = rbgobj_boxed_get_raw(obj);
|
202
|
+
boxed_holder *holder = rbgobj_boxed_get_raw(obj);
|
192
203
|
if (!holder->boxed)
|
193
204
|
rb_raise(rb_eArgError, "uninitialize %" PRIsVALUE,
|
194
205
|
CLASS_OF(obj));
|
data/ext/glib2/rbgobj_object.c
CHANGED
@@ -1044,6 +1044,11 @@ rbgobj_register_type(VALUE klass, VALUE type_name, GClassInitFunc class_init)
|
|
1044
1044
|
StringValueCStr(type_name),
|
1045
1045
|
info,
|
1046
1046
|
0);
|
1047
|
+
if (type == G_TYPE_INVALID) {
|
1048
|
+
rb_raise(rb_eArgError,
|
1049
|
+
"failed to register type: <%s>",
|
1050
|
+
StringValueCStr(type_name));
|
1051
|
+
}
|
1047
1052
|
|
1048
1053
|
rbgobj_register_class(klass, type, TRUE, TRUE);
|
1049
1054
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glib2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pkg-config
|