glib2 3.1.0-x86-mingw32 → 3.1.1-x86-mingw32

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 (128) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +2 -2
  3. data/ext/glib2/rbglib.c +2 -0
  4. data/ext/glib2/rbglib.h +1 -1
  5. data/ext/glib2/rbglib2conversions.h +3 -0
  6. data/ext/glib2/rbglib_datetime.c +250 -0
  7. data/ext/glib2/rbglib_timezone.c +82 -0
  8. data/ext/glib2/rbgprivate.h +2 -0
  9. data/lib/2.2/glib2.so +0 -0
  10. data/lib/2.3/glib2.so +0 -0
  11. data/lib/2.4/glib2.so +0 -0
  12. data/lib/glib2.rb +15 -7
  13. data/lib/gnome2/rake/external-package.rb +35 -5
  14. data/lib/gnome2/rake/source-download-task.rb +25 -5
  15. data/lib/mkmf-gnome2.rb +1 -6
  16. data/test/test-date-time.rb +112 -0
  17. data/test/test-time-zone.rb +31 -0
  18. data/vendor/local/bin/asn1Coding.exe +0 -0
  19. data/vendor/local/bin/asn1Decoding.exe +0 -0
  20. data/vendor/local/bin/asn1Parser.exe +0 -0
  21. data/vendor/local/bin/envsubst.exe +0 -0
  22. data/vendor/local/bin/gdbus.exe +0 -0
  23. data/vendor/local/bin/gettext.exe +0 -0
  24. data/vendor/local/bin/gio-querymodules.exe +0 -0
  25. data/vendor/local/bin/gio.exe +0 -0
  26. data/vendor/local/bin/glib-compile-resources.exe +0 -0
  27. data/vendor/local/bin/glib-compile-schemas.exe +0 -0
  28. data/vendor/local/bin/glib-genmarshal.exe +0 -0
  29. data/vendor/local/bin/gobject-query.exe +0 -0
  30. data/vendor/local/bin/gresource.exe +0 -0
  31. data/vendor/local/bin/gsettings.exe +0 -0
  32. data/vendor/local/bin/gspawn-win32-helper-console.exe +0 -0
  33. data/vendor/local/bin/gspawn-win32-helper.exe +0 -0
  34. data/vendor/local/bin/iconv.exe +0 -0
  35. data/vendor/local/bin/idn.exe +0 -0
  36. data/vendor/local/bin/libasprintf-0.dll +0 -0
  37. data/vendor/local/bin/libcharset-1.dll +0 -0
  38. data/vendor/local/bin/libffi-6.dll +0 -0
  39. data/vendor/local/bin/libgio-2.0-0.dll +0 -0
  40. data/vendor/local/bin/libglib-2.0-0.dll +0 -0
  41. data/vendor/local/bin/libgmodule-2.0-0.dll +0 -0
  42. data/vendor/local/bin/libgmp-10.dll +0 -0
  43. data/vendor/local/bin/libgnutls-30.dll +0 -0
  44. data/vendor/local/bin/libgobject-2.0-0.dll +0 -0
  45. data/vendor/local/bin/libgthread-2.0-0.dll +0 -0
  46. data/vendor/local/bin/libhogweed-4-2.dll +0 -0
  47. data/vendor/local/bin/libiconv-2.dll +0 -0
  48. data/vendor/local/bin/libidn-11.dll +0 -0
  49. data/vendor/local/bin/libintl-8.dll +0 -0
  50. data/vendor/local/bin/libnettle-6-2.dll +0 -0
  51. data/vendor/local/bin/libp11-kit-0.dll +0 -0
  52. data/vendor/local/bin/libpcre-1.dll +0 -0
  53. data/vendor/local/bin/libpcrecpp-0.dll +0 -0
  54. data/vendor/local/bin/libpcreposix-0.dll +0 -0
  55. data/vendor/local/bin/libtasn1-6.dll +0 -0
  56. data/vendor/local/bin/nettle-hash.exe +0 -0
  57. data/vendor/local/bin/nettle-lfib-stream.exe +0 -0
  58. data/vendor/local/bin/nettle-pbkdf2.exe +0 -0
  59. data/vendor/local/bin/ngettext.exe +0 -0
  60. data/vendor/local/bin/p11-kit.exe +0 -0
  61. data/vendor/local/bin/pcre-config +1 -1
  62. data/vendor/local/bin/pcregrep.exe +0 -0
  63. data/vendor/local/bin/pcretest.exe +0 -0
  64. data/vendor/local/bin/pkcs1-conv.exe +0 -0
  65. data/vendor/local/bin/sexp-conv.exe +0 -0
  66. data/vendor/local/bin/trust.exe +0 -0
  67. data/vendor/local/include/pcre.h +2 -2
  68. data/vendor/local/lib/gio/modules/libgiognutls.dll +0 -0
  69. data/vendor/local/lib/gio/modules/libgiognutls.dll.a +0 -0
  70. data/vendor/local/lib/libasprintf.dll.a +0 -0
  71. data/vendor/local/lib/libcharset.dll.a +0 -0
  72. data/vendor/local/lib/libffi.dll.a +0 -0
  73. data/vendor/local/lib/libgio-2.0.dll.a +0 -0
  74. data/vendor/local/lib/libglib-2.0.dll.a +0 -0
  75. data/vendor/local/lib/libgmodule-2.0.dll.a +0 -0
  76. data/vendor/local/lib/libgmp.dll.a +0 -0
  77. data/vendor/local/lib/libgnutls.dll.a +0 -0
  78. data/vendor/local/lib/libgobject-2.0.dll.a +0 -0
  79. data/vendor/local/lib/libgthread-2.0.dll.a +0 -0
  80. data/vendor/local/lib/libhogweed.dll.a +0 -0
  81. data/vendor/local/lib/libiconv.dll.a +0 -0
  82. data/vendor/local/lib/libidn.dll.a +0 -0
  83. data/vendor/local/lib/libintl.dll.a +0 -0
  84. data/vendor/local/lib/libnettle.dll.a +0 -0
  85. data/vendor/local/lib/libp11-kit.dll.a +0 -0
  86. data/vendor/local/lib/libpcre.a +0 -0
  87. data/vendor/local/lib/libpcre.dll.a +0 -0
  88. data/vendor/local/lib/libpcre.la +1 -1
  89. data/vendor/local/lib/libpcrecpp.dll.a +0 -0
  90. data/vendor/local/lib/libpcreposix.a +0 -0
  91. data/vendor/local/lib/libpcreposix.dll.a +0 -0
  92. data/vendor/local/lib/libpcreposix.la +1 -1
  93. data/vendor/local/lib/libtasn1.dll.a +0 -0
  94. data/vendor/local/lib/p11-kit/p11-kit-remote.exe +0 -0
  95. data/vendor/local/lib/pkcs11/p11-kit-trust.dll +0 -0
  96. data/vendor/local/lib/pkcs11/p11-kit-trust.dll.a +0 -0
  97. data/vendor/local/lib/pkgconfig/libpcre.pc +1 -1
  98. data/vendor/local/lib/pkgconfig/libpcrecpp.pc +1 -1
  99. data/vendor/local/lib/pkgconfig/libpcreposix.pc +1 -1
  100. data/vendor/local/share/doc/pcre/AUTHORS +3 -3
  101. data/vendor/local/share/doc/pcre/ChangeLog +140 -1
  102. data/vendor/local/share/doc/pcre/LICENCE +3 -3
  103. data/vendor/local/share/doc/pcre/NEWS +15 -0
  104. data/vendor/local/share/doc/pcre/html/pcreapi.html +4 -5
  105. data/vendor/local/share/doc/pcre/html/pcrecompat.html +1 -1
  106. data/vendor/local/share/doc/pcre/html/pcrepattern.html +20 -17
  107. data/vendor/local/share/doc/pcre/pcre.txt +2024 -2020
  108. data/vendor/local/share/glib-2.0/codegen/__init__.pyc +0 -0
  109. data/vendor/local/share/glib-2.0/codegen/__init__.pyo +0 -0
  110. data/vendor/local/share/glib-2.0/codegen/codegen.pyc +0 -0
  111. data/vendor/local/share/glib-2.0/codegen/codegen.pyo +0 -0
  112. data/vendor/local/share/glib-2.0/codegen/codegen_docbook.pyc +0 -0
  113. data/vendor/local/share/glib-2.0/codegen/codegen_docbook.pyo +0 -0
  114. data/vendor/local/share/glib-2.0/codegen/codegen_main.pyc +0 -0
  115. data/vendor/local/share/glib-2.0/codegen/codegen_main.pyo +0 -0
  116. data/vendor/local/share/glib-2.0/codegen/config.pyc +0 -0
  117. data/vendor/local/share/glib-2.0/codegen/config.pyo +0 -0
  118. data/vendor/local/share/glib-2.0/codegen/dbustypes.pyc +0 -0
  119. data/vendor/local/share/glib-2.0/codegen/dbustypes.pyo +0 -0
  120. data/vendor/local/share/glib-2.0/codegen/parser.pyc +0 -0
  121. data/vendor/local/share/glib-2.0/codegen/parser.pyo +0 -0
  122. data/vendor/local/share/glib-2.0/codegen/utils.pyc +0 -0
  123. data/vendor/local/share/glib-2.0/codegen/utils.pyo +0 -0
  124. data/vendor/local/share/license/pcre/AUTHORS +3 -3
  125. data/vendor/local/share/man/man3/pcreapi.3 +5 -6
  126. data/vendor/local/share/man/man3/pcrecompat.3 +1 -1
  127. data/vendor/local/share/man/man3/pcrepattern.3 +20 -17
  128. metadata +11 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b91d2ee97cd4a99550c7af3b609b5949f0e288ed
4
- data.tar.gz: fc6f8d59d4ce119e5ccc3cccbd75c17a40419e81
3
+ metadata.gz: 73f5bd3c313946391f89b67d5b1abe326257b0c0
4
+ data.tar.gz: 4f4de89c485d946f3016c37ea48c1ac9c5360877
5
5
  SHA512:
6
- metadata.gz: 5255f12718a022a36ca867d3171855dd2343be4b1d1c8da5d22a521685d9b3518bb1b946898762c4065fffa5f4e76f0a55f078e6fd02ca7f56a469d3a829926c
7
- data.tar.gz: 098716aa4d68cc2c22416d6c542d04b27946dbd59e742ec2b5f1328c26e607b2b2039faade52049e196371d9a949712d2e6f1fdcc7fcc83502dc26b238a80747
6
+ metadata.gz: 0de43fa7cdd8ff369a5a6fc3519498b8ac8574adc3c28ff12d6dd59342edbedd02cba71f44b7fa6b494080cea5346ba231544872ede2870b4e0c6eb79a987b9d
7
+ data.tar.gz: feb187f9bada12f36573d6dd385799707cf0c3cd4affa9453e2fc28c7b856eb8206b05634d1658cda4792726d9076643fcd857e470d6ff671139bb6b5d3f4aa4
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2011-2015 Ruby-GNOME2 Project Team
3
+ # Copyright (C) 2011-2017 Ruby-GNOME2 Project Team
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -73,7 +73,7 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
73
73
  :name => "pcre",
74
74
  :download_base_url => "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre",
75
75
  :label => "PCRE",
76
- :version => "8.38",
76
+ :version => "8.40",
77
77
  :windows => {
78
78
  :configure_args => [
79
79
  "--enable-unicode-properties",
data/ext/glib2/rbglib.c CHANGED
@@ -1187,4 +1187,6 @@ union GDoubleIEEE754;
1187
1187
  Init_glib_variant();
1188
1188
  Init_glib_regex();
1189
1189
  Init_glib_matchinfo();
1190
+ Init_glib_date_time();
1191
+ Init_glib_time_zone();
1190
1192
  }
data/ext/glib2/rbglib.h CHANGED
@@ -36,7 +36,7 @@ extern "C" {
36
36
 
37
37
  #define RBGLIB_MAJOR_VERSION 3
38
38
  #define RBGLIB_MINOR_VERSION 1
39
- #define RBGLIB_MICRO_VERSION 0
39
+ #define RBGLIB_MICRO_VERSION 1
40
40
 
41
41
  #ifndef RB_ZALLOC
42
42
  # ifdef ZALLOC
@@ -62,4 +62,7 @@
62
62
  #define RVAL2GREGEXMATCHOPTIONSFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_REGEX_MATCH_FLAGS))
63
63
  #define RVAL2GREGEXCOMPILEOPTIONSFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_REGEX_COMPILE_FLAGS))
64
64
  #define GMATCHINFO2RVAL(o) (BOXED2RVAL(o, G_TYPE_MATCH_INFO))
65
+ #define GDATETIME2RVAL(o) (BOXED2RVAL(o, G_TYPE_DATE_TIME))
66
+ #define GTIMEZONE2RVAL(o) (BOXED2RVAL(o, G_TYPE_TIME_ZONE))
67
+ #define RVAL2GTIMEZONE(o) ((GTimeZone*)RVAL2BOXED(o, G_TYPE_TIME_ZONE))
65
68
  #endif /* __GLIB2CONVERSIONS_H__ */
@@ -0,0 +1,250 @@
1
+ /*
2
+ * Copyright (C) 2016 Ruby-GNOME2 Project Team
3
+ *
4
+ * This library is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU Lesser General Public
6
+ * License as published by the Free Software Foundation; either
7
+ * version 2.1 of the License, or (at your option) any later version.
8
+ *
9
+ * This library is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ * Lesser General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Lesser General Public
15
+ * License along with this library; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17
+ * MA 02110-1301 USA
18
+ */
19
+
20
+ #include "rbgprivate.h"
21
+
22
+ #define RG_TARGET_NAMESPACE cDateTime
23
+ #define _SELF(s) ((GDateTime*)RVAL2BOXED(s, G_TYPE_DATE_TIME))
24
+
25
+ static gboolean
26
+ is_local_timezone(VALUE rb_timezone)
27
+ {
28
+ ID id_equal;
29
+ ID id_local;
30
+
31
+ if (NIL_P(rb_timezone)) {
32
+ return TRUE;
33
+ }
34
+
35
+ CONST_ID(id_equal, "==");
36
+ CONST_ID(id_local, "local");
37
+ return RVAL2CBOOL(rb_funcall(rb_timezone, id_equal, 1, ID2SYM(id_local)));
38
+ }
39
+
40
+ static gboolean
41
+ is_utc_timezone(VALUE rb_timezone)
42
+ {
43
+ ID id_equal;
44
+ ID id_utc;
45
+
46
+ CONST_ID(id_equal, "==");
47
+ CONST_ID(id_utc, "utc");
48
+ return RVAL2CBOOL(rb_funcall(rb_timezone, id_equal, 1, ID2SYM(id_utc)));
49
+ }
50
+
51
+ static gboolean
52
+ is_timezone(VALUE rb_timezone)
53
+ {
54
+ VALUE rb_cTimeZone;
55
+
56
+ rb_cTimeZone = rb_const_get(mGLib, rb_intern("TimeZone"));
57
+ return RVAL2CBOOL(rb_obj_is_kind_of(rb_timezone, rb_cTimeZone));
58
+ }
59
+
60
+ static VALUE
61
+ rg_s_now(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
62
+ {
63
+ GDateTime *date = NULL;
64
+ VALUE rb_timezone;
65
+
66
+ rb_scan_args(argc, argv, "01", &rb_timezone);
67
+
68
+ if (is_local_timezone(rb_timezone)) {
69
+ date = g_date_time_new_now_local();
70
+ } else if (is_utc_timezone(rb_timezone)) {
71
+ date = g_date_time_new_now_utc();
72
+ } else if (is_timezone(rb_timezone)) {
73
+ date = g_date_time_new_now(RVAL2GTIMEZONE(rb_timezone));
74
+ } else {
75
+ rb_raise(rb_eArgError,
76
+ "timezone must be nil, :local, :utc or GLib::TimeZone: "
77
+ "%+" PRIsVALUE,
78
+ rb_timezone);
79
+ }
80
+
81
+ return GDATETIME2RVAL(date);
82
+ }
83
+
84
+ static VALUE
85
+ rg_initialize(int argc, VALUE *argv, VALUE self)
86
+ {
87
+ /*
88
+ * Not implemented:
89
+ * GDateTime * g_date_time_new_from_timeval_local ()
90
+ * GDateTime * g_date_time_new_from_timeval_utc ()
91
+ * https://developer.gnome.org/glib/stable/glib-Date-and-Time-Functions.html#GTimeVal
92
+ * */
93
+ VALUE rb_options;
94
+ VALUE rb_unix;
95
+ VALUE rb_timezone;
96
+ VALUE rb_year;
97
+ VALUE rb_month;
98
+ VALUE rb_day;
99
+ VALUE rb_hour;
100
+ VALUE rb_minute;
101
+ VALUE rb_second;
102
+ GDateTime *datetime = NULL;
103
+
104
+ rb_scan_args(argc, argv, "1", &rb_options);
105
+ rbg_scan_options(rb_options,
106
+ "unix", &rb_unix,
107
+ "timezone", &rb_timezone,
108
+ "year", &rb_year,
109
+ "month", &rb_month,
110
+ "day", &rb_day,
111
+ "hour", &rb_hour,
112
+ "minute", &rb_minute,
113
+ "second", &rb_second,
114
+ NULL);
115
+
116
+ if (!NIL_P(rb_unix)) {
117
+ gint64 unix_time;
118
+
119
+ unix_time = rbglib_num_to_int64(rb_unix);
120
+ if (is_local_timezone(rb_timezone)) {
121
+ datetime = g_date_time_new_from_unix_local(unix_time);
122
+ } else if (is_utc_timezone(rb_timezone)) {
123
+ datetime = g_date_time_new_from_unix_utc(unix_time);
124
+ } else {
125
+ rb_raise(rb_eArgError,
126
+ ":timezone must be nil, :local or :utc: %+" PRIsVALUE,
127
+ rb_timezone);
128
+ }
129
+ } else if (!NIL_P(rb_year) &&
130
+ !NIL_P(rb_month) &&
131
+ !NIL_P(rb_hour) &&
132
+ !NIL_P(rb_minute) &&
133
+ !NIL_P(rb_second)) {
134
+ gint year = 0;
135
+ gint month = 0;
136
+ gint day = 0;
137
+ gint hour = 0;
138
+ gint minute = 0;
139
+ gdouble second = 0.0;
140
+
141
+ year = NUM2INT(rb_year);
142
+ month = NUM2INT(rb_month);
143
+ day = NUM2INT(rb_day);
144
+ hour = NUM2INT(rb_hour);
145
+ minute = NUM2INT(rb_minute);
146
+ second = NUM2DBL(rb_second);
147
+ if (is_local_timezone(rb_timezone)) {
148
+ datetime = g_date_time_new_local(year,
149
+ month,
150
+ day,
151
+ hour,
152
+ minute,
153
+ second);
154
+ } else if (is_utc_timezone(rb_timezone)) {
155
+ datetime = g_date_time_new_utc(year,
156
+ month,
157
+ day,
158
+ hour,
159
+ minute,
160
+ second);
161
+ } else if (is_timezone(rb_timezone)) {
162
+ GTimeZone *timezone = NULL;
163
+
164
+ timezone = RVAL2GTIMEZONE(rb_timezone);
165
+ datetime = g_date_time_new(timezone,
166
+ year,
167
+ month,
168
+ day,
169
+ hour,
170
+ minute,
171
+ second);
172
+ } else {
173
+ rb_raise(rb_eArgError,
174
+ ":timezone must be nil, :local, :utc or GLib::TimeZone: "
175
+ "%+" PRIsVALUE,
176
+ rb_timezone);
177
+ }
178
+ } else {
179
+ rb_raise(rb_eArgError,
180
+ ":unix or (:year, :month, :day, :hour, :minute and :second) "
181
+ "must be specified: %+" PRIsVALUE,
182
+ rb_options);
183
+ }
184
+
185
+ G_INITIALIZE(self, datetime);
186
+
187
+ return Qnil;
188
+ }
189
+
190
+ static VALUE
191
+ rg_year(VALUE self)
192
+ {
193
+ return INT2NUM(g_date_time_get_year(_SELF(self)));
194
+ }
195
+
196
+ static VALUE
197
+ rg_month(VALUE self)
198
+ {
199
+ return INT2NUM(g_date_time_get_month(_SELF(self)));
200
+ }
201
+
202
+ static VALUE
203
+ rg_day_of_month(VALUE self)
204
+ {
205
+ return INT2NUM(g_date_time_get_day_of_month(_SELF(self)));
206
+ }
207
+
208
+ static VALUE
209
+ rg_hour(VALUE self)
210
+ {
211
+ return INT2NUM(g_date_time_get_hour(_SELF(self)));
212
+ }
213
+
214
+ static VALUE
215
+ rg_minute(VALUE self)
216
+ {
217
+ return INT2NUM(g_date_time_get_minute(_SELF(self)));
218
+ }
219
+
220
+ static VALUE
221
+ rg_second(VALUE self)
222
+ {
223
+ return DBL2NUM(g_date_time_get_second(_SELF(self)));
224
+ }
225
+
226
+ static VALUE
227
+ rg_format(VALUE self, VALUE rb_format)
228
+ {
229
+ const gchar *format = RVAL2CSTR(rb_format);
230
+ return CSTR2RVAL(g_date_time_format(_SELF(self), format));
231
+ }
232
+
233
+ void
234
+ Init_glib_date_time(void)
235
+ {
236
+ VALUE RG_TARGET_NAMESPACE;
237
+
238
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_DATE_TIME, "DateTime", mGLib);
239
+
240
+ RG_DEF_SMETHOD(now, -1);
241
+
242
+ RG_DEF_METHOD(initialize, -1);
243
+ RG_DEF_METHOD(year, 0);
244
+ RG_DEF_METHOD(month, 0);
245
+ RG_DEF_METHOD(day_of_month, 0);
246
+ RG_DEF_METHOD(hour, 0);
247
+ RG_DEF_METHOD(minute, 0);
248
+ RG_DEF_METHOD(second, 0);
249
+ RG_DEF_METHOD(format, 1);
250
+ }
@@ -0,0 +1,82 @@
1
+ /*
2
+ * Copyright (C) 2016 Ruby-GNOME2 Project Team
3
+ *
4
+ * This library is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU Lesser General Public
6
+ * License as published by the Free Software Foundation; either
7
+ * version 2.1 of the License, or (at your option) any later version.
8
+ *
9
+ * This library is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ * Lesser General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Lesser General Public
15
+ * License along with this library; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17
+ * MA 02110-1301 USA
18
+ */
19
+
20
+ #include "rbgprivate.h"
21
+
22
+ #define RG_TARGET_NAMESPACE cTimeZone
23
+ #define _SELF(s) ((GTimeZone*)RVAL2BOXED(s, G_TYPE_TIME_ZONE))
24
+
25
+ static VALUE
26
+ rg_initialize(gint argc, VALUE *argv, VALUE self)
27
+ {
28
+ VALUE rb_identifier = Qnil;
29
+ const gchar *identifier = NULL;
30
+ GTimeZone *time_zone = NULL;
31
+
32
+ rb_scan_args(argc, argv, "01", &rb_identifier);
33
+
34
+ if (!NIL_P(rb_identifier))
35
+ identifier = RVAL2CSTR(rb_identifier);
36
+
37
+ time_zone = g_time_zone_new(identifier);
38
+ G_INITIALIZE(self, time_zone);
39
+ return Qnil;
40
+ }
41
+
42
+ static VALUE
43
+ rg_s_local(G_GNUC_UNUSED VALUE self)
44
+ {
45
+ GTimeZone *time_zone = NULL;
46
+ time_zone = g_time_zone_new_local();
47
+ return GTIMEZONE2RVAL(time_zone);
48
+ }
49
+
50
+ static VALUE
51
+ rg_s_utc(G_GNUC_UNUSED VALUE self)
52
+ {
53
+ GTimeZone *time_zone = NULL;
54
+ time_zone = g_time_zone_new_utc();
55
+ return GTIMEZONE2RVAL(time_zone);
56
+ }
57
+
58
+ static VALUE
59
+ rg_abbreviation(VALUE self, VALUE rb_interval)
60
+ {
61
+ gint interval = NUM2INT(rb_interval);
62
+ return CSTR2RVAL(g_time_zone_get_abbreviation(_SELF(self), interval));
63
+ }
64
+
65
+ static VALUE
66
+ rg_offset(VALUE self, VALUE rb_interval)
67
+ {
68
+ gint interval = NUM2INT(rb_interval);
69
+ return INT2NUM(g_time_zone_get_offset(_SELF(self), interval));
70
+ }
71
+
72
+ void
73
+ Init_glib_time_zone(void)
74
+ {
75
+ VALUE RG_TARGET_NAMESPACE;
76
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_TIME_ZONE, "TimeZone", mGLib);
77
+ RG_DEF_METHOD(initialize, -1);
78
+ RG_DEF_SMETHOD(local, 0);
79
+ RG_DEF_SMETHOD(utc, 0);
80
+ RG_DEF_METHOD(abbreviation, 1);
81
+ RG_DEF_METHOD(offset, 1);
82
+ }
@@ -150,6 +150,8 @@ G_GNUC_INTERNAL void Init_glib_variant_type(void);
150
150
  G_GNUC_INTERNAL void Init_glib_variant(void);
151
151
  G_GNUC_INTERNAL void Init_glib_regex(void);
152
152
  G_GNUC_INTERNAL void Init_glib_matchinfo(void);
153
+ G_GNUC_INTERNAL void Init_glib_date_time(void);
154
+ G_GNUC_INTERNAL void Init_glib_time_zone(void);
153
155
 
154
156
  G_GNUC_INTERNAL void Init_gobject_convert(void);
155
157
  G_GNUC_INTERNAL void Init_gobject_gtype(void);
data/lib/2.2/glib2.so CHANGED
Binary file
data/lib/2.3/glib2.so CHANGED
Binary file
data/lib/2.4/glib2.so ADDED
Binary file
data/lib/glib2.rb CHANGED
@@ -187,7 +187,7 @@ module GLib
187
187
 
188
188
  module Log
189
189
  DOMAIN = "Ruby/GLib"
190
- LEVELS = {
190
+ LEVELS = {
191
191
  LEVEL_ERROR => "ERROR",
192
192
  LEVEL_CRITICAL => "CRITICAL",
193
193
  LEVEL_WARNING => "WARNING",
@@ -207,15 +207,23 @@ module GLib
207
207
  log(DOMAIN, LEVEL_CRITICAL, caller(1)[0] << ": " << str)
208
208
  end
209
209
  def warning(str)
210
- log(DOMAIN, LEVEL_WARNING, caller(1)[0] << ": " << str)
210
+ log(DOMAIN, LEVEL_WARNING, caller(1)[0] << ": " << str)
211
211
  end
212
-
212
+
213
213
  def set_log_domain(domain)
214
- level = GLib::Log::LEVEL_MASK
214
+ level =
215
+ FLAG_RECURSION |
216
+ FLAG_FATAL |
217
+ LEVEL_ERROR |
218
+ LEVEL_CRITICAL |
219
+ LEVEL_WARNING
220
+ if $VERBOSE or $DEBUG
221
+ level |=
222
+ LEVEL_MESSAGE |
223
+ LEVEL_INFO
224
+ end
215
225
  if $DEBUG
216
- level = 255
217
- elsif $VERBOSE
218
- level = 127
226
+ level |= LEVEL_DEBUG
219
227
  end
220
228
  GLib::Log.set_handler(domain, level)
221
229
  end