glib2 2.2.3 → 2.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,154 @@
1
+
2
+ /* Generated by glib-mkenums.rb ($Id$) */
3
+
4
+ #ifndef __GLIB_ENUM_TYPES_H__
5
+ #define __GLIB_ENUM_TYPES_H__
6
+
7
+ #include <glib-object.h>
8
+
9
+ G_BEGIN_DECLS
10
+
11
+ /* enumerations from "/usr/include/glib-2.0/glib/gvariant.h" */
12
+ GType g_variant_class_get_type (void);
13
+ #define G_TYPE_VARIANT_CLASS (g_variant_class_get_type())
14
+ GType g_variant_parse_error_get_type (void);
15
+ #define G_TYPE_VARIANT_PARSE_ERROR (g_variant_parse_error_get_type())
16
+
17
+ /* enumerations from "/usr/include/glib-2.0/glib/gspawn.h" */
18
+ GType g_spawn_error_get_type (void);
19
+ #define G_TYPE_SPAWN_ERROR (g_spawn_error_get_type())
20
+ GType g_spawn_flags_get_type (void);
21
+ #define G_TYPE_SPAWN_FLAGS (g_spawn_flags_get_type())
22
+
23
+ /* enumerations from "/usr/include/glib-2.0/glib/gkeyfile.h" */
24
+ GType g_key_file_error_get_type (void);
25
+ #define G_TYPE_KEY_FILE_ERROR (g_key_file_error_get_type())
26
+ GType g_key_file_flags_get_type (void);
27
+ #define G_TYPE_KEY_FILE_FLAGS (g_key_file_flags_get_type())
28
+
29
+ /* enumerations from "/usr/include/glib-2.0/glib/gnode.h" */
30
+ GType g_traverse_flags_get_type (void);
31
+ #define G_TYPE_TRAVERSE_FLAGS (g_traverse_flags_get_type())
32
+ GType g_traverse_type_get_type (void);
33
+ #define G_TYPE_TRAVERSE_TYPE (g_traverse_type_get_type())
34
+
35
+ /* enumerations from "/usr/include/glib-2.0/glib/gshell.h" */
36
+ GType g_shell_error_get_type (void);
37
+ #define G_TYPE_SHELL_ERROR (g_shell_error_get_type())
38
+
39
+ /* enumerations from "/usr/include/glib-2.0/glib/gslice.h" */
40
+ GType g_slice_config_get_type (void);
41
+ #define G_TYPE_SLICE_CONFIG (g_slice_config_get_type())
42
+
43
+ /* enumerations from "/usr/include/glib-2.0/glib/gregex.h" */
44
+ GType g_regex_error_get_type (void);
45
+ #define G_TYPE_REGEX_ERROR (g_regex_error_get_type())
46
+ GType g_regex_compile_flags_get_type (void);
47
+ #define G_TYPE_REGEX_COMPILE_FLAGS (g_regex_compile_flags_get_type())
48
+ GType g_regex_match_flags_get_type (void);
49
+ #define G_TYPE_REGEX_MATCH_FLAGS (g_regex_match_flags_get_type())
50
+
51
+ /* enumerations from "/usr/include/glib-2.0/glib/gmarkup.h" */
52
+ GType g_markup_error_get_type (void);
53
+ #define G_TYPE_MARKUP_ERROR (g_markup_error_get_type())
54
+ GType g_markup_parse_flags_get_type (void);
55
+ #define G_TYPE_MARKUP_PARSE_FLAGS (g_markup_parse_flags_get_type())
56
+ GType g_markup_collect_type_get_type (void);
57
+ #define G_TYPE_MARKUP_COLLECT_TYPE (g_markup_collect_type_get_type())
58
+
59
+ /* enumerations from "/usr/include/glib-2.0/glib/gtestutils.h" */
60
+ GType g_test_trap_flags_get_type (void);
61
+ #define G_TYPE_TEST_TRAP_FLAGS (g_test_trap_flags_get_type())
62
+ GType g_test_subprocess_flags_get_type (void);
63
+ #define G_TYPE_TEST_SUBPROCESS_FLAGS (g_test_subprocess_flags_get_type())
64
+ GType g_test_log_type_get_type (void);
65
+ #define G_TYPE_TEST_LOG_TYPE (g_test_log_type_get_type())
66
+ GType g_test_file_type_get_type (void);
67
+ #define G_TYPE_TEST_FILE_TYPE (g_test_file_type_get_type())
68
+
69
+ /* enumerations from "/usr/include/glib-2.0/glib/gfileutils.h" */
70
+ GType g_file_error_get_type (void);
71
+ #define G_TYPE_FILE_ERROR (g_file_error_get_type())
72
+ GType g_file_test_get_type (void);
73
+ #define G_TYPE_FILE_TEST (g_file_test_get_type())
74
+
75
+ /* enumerations from "/usr/include/glib-2.0/glib/gtimezone.h" */
76
+ GType g_time_type_get_type (void);
77
+ #define G_TYPE_TIME_TYPE (g_time_type_get_type())
78
+
79
+ /* enumerations from "/usr/include/glib-2.0/glib/gdate.h" */
80
+ GType g_date_dm_y_get_type (void);
81
+ #define G_TYPE_DATE_DM_Y (g_date_dm_y_get_type())
82
+ GType g_date_weekday_get_type (void);
83
+ #define G_TYPE_DATE_WEEKDAY (g_date_weekday_get_type())
84
+ GType g_date_month_get_type (void);
85
+ #define G_TYPE_DATE_MONTH (g_date_month_get_type())
86
+
87
+ /* enumerations from "/usr/include/glib-2.0/glib/gunicode.h" */
88
+ GType g_unicode_type_get_type (void);
89
+ #define G_TYPE_UNICODE_TYPE (g_unicode_type_get_type())
90
+ GType g_unicode_break_type_get_type (void);
91
+ #define G_TYPE_UNICODE_BREAK_TYPE (g_unicode_break_type_get_type())
92
+ GType g_unicode_script_get_type (void);
93
+ #define G_TYPE_UNICODE_SCRIPT (g_unicode_script_get_type())
94
+ GType g_normalize_mode_get_type (void);
95
+ #define G_TYPE_NORMALIZE_MODE (g_normalize_mode_get_type())
96
+
97
+ /* enumerations from "/usr/include/glib-2.0/glib/ghook.h" */
98
+ GType g_hook_flag_mask_get_type (void);
99
+ #define G_TYPE_HOOK_FLAG_MASK (g_hook_flag_mask_get_type())
100
+
101
+ /* enumerations from "/usr/include/glib-2.0/glib/gthread.h" */
102
+ GType g_thread_error_get_type (void);
103
+ #define G_TYPE_THREAD_ERROR (g_thread_error_get_type())
104
+ GType g_once_status_get_type (void);
105
+ #define G_TYPE_ONCE_STATUS (g_once_status_get_type())
106
+
107
+ /* enumerations from "/usr/include/glib-2.0/glib/gstrfuncs.h" */
108
+ GType g_ascii_type_get_type (void);
109
+ #define G_TYPE_ASCII_TYPE (g_ascii_type_get_type())
110
+
111
+ /* enumerations from "/usr/include/glib-2.0/glib/gmessages.h" */
112
+ GType g_log_level_flags_get_type (void);
113
+ #define G_TYPE_LOG_LEVEL_FLAGS (g_log_level_flags_get_type())
114
+
115
+ /* enumerations from "/usr/include/glib-2.0/glib/gchecksum.h" */
116
+ GType g_checksum_type_get_type (void);
117
+ #define G_TYPE_CHECKSUM_TYPE (g_checksum_type_get_type())
118
+
119
+ /* enumerations from "/usr/include/glib-2.0/glib/gutils.h" */
120
+ GType g_user_directory_get_type (void);
121
+ #define G_TYPE_USER_DIRECTORY (g_user_directory_get_type())
122
+ GType g_format_size_flags_get_type (void);
123
+ #define G_TYPE_FORMAT_SIZE_FLAGS (g_format_size_flags_get_type())
124
+
125
+ /* enumerations from "/usr/include/glib-2.0/glib/goption.h" */
126
+ GType g_option_flags_get_type (void);
127
+ #define G_TYPE_OPTION_FLAGS (g_option_flags_get_type())
128
+ GType g_option_arg_get_type (void);
129
+ #define G_TYPE_OPTION_ARG (g_option_arg_get_type())
130
+ GType g_option_error_get_type (void);
131
+ #define G_TYPE_OPTION_ERROR (g_option_error_get_type())
132
+
133
+ /* enumerations from "/usr/include/glib-2.0/glib/gconvert.h" */
134
+ GType g_convert_error_get_type (void);
135
+ #define G_TYPE_CONVERT_ERROR (g_convert_error_get_type())
136
+
137
+ /* enumerations from "/usr/include/glib-2.0/glib/gbookmarkfile.h" */
138
+ GType g_bookmark_file_error_get_type (void);
139
+ #define G_TYPE_BOOKMARK_FILE_ERROR (g_bookmark_file_error_get_type())
140
+
141
+ /* enumerations from "/usr/include/glib-2.0/gobject/gsignal.h" */
142
+ GType g_signal_flags_get_type (void);
143
+ #define G_TYPE_SIGNAL_FLAGS (g_signal_flags_get_type())
144
+ GType g_connect_flags_get_type (void);
145
+ #define G_TYPE_CONNECT_FLAGS (g_connect_flags_get_type())
146
+ GType g_signal_match_type_get_type (void);
147
+ #define G_TYPE_SIGNAL_MATCH_TYPE (g_signal_match_type_get_type())
148
+
149
+ G_END_DECLS
150
+
151
+ #endif /* __GLIB_ENUM_TYPES_H__ */
152
+
153
+ /* Generated data ends here */
154
+
@@ -912,14 +912,14 @@ So they occur "cross-thread violation".
912
912
  static gpointer
913
913
  my_malloc(gsize n_bytes)
914
914
  {
915
- /* Should we rescue NoMemoryError? */
915
+ /* Should we rescue NoMemoryError? */
916
916
  return ruby_xmalloc(n_bytes);
917
917
  }
918
918
 
919
919
  static gpointer
920
920
  my_realloc(gpointer mem, gsize n_bytes)
921
921
  {
922
- /* Should we rescue NoMemoryError? */
922
+ /* Should we rescue NoMemoryError? */
923
923
  return ruby_xrealloc(mem, n_bytes);
924
924
  }
925
925
 
@@ -36,7 +36,7 @@ extern "C" {
36
36
 
37
37
  #define RBGLIB_MAJOR_VERSION 2
38
38
  #define RBGLIB_MINOR_VERSION 2
39
- #define RBGLIB_MICRO_VERSION 3
39
+ #define RBGLIB_MICRO_VERSION 4
40
40
 
41
41
  #ifndef RSTRING_PTR
42
42
  # define RSTRING_PTR(s) (RSTRING(s)->ptr)
@@ -52,4 +52,6 @@
52
52
  #define RVAL2GKEYFILEFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_KEY_FILE_FLAGS))
53
53
  #define GKEYFILEFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_KEY_FILE_FLAGS))
54
54
 
55
+ #define RVAL2GFORMATSIZEFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_FORMAT_SIZE_FLAGS))
56
+ #define GFORMATSIZEFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_FORMAT_SIZE_FLAGS))
55
57
  #endif /* __GLIB2CONVERSIONS_H__ */
@@ -57,6 +57,27 @@ rbglib_m_format_size_for_display(G_GNUC_UNUSED VALUE self, VALUE size)
57
57
  }
58
58
  #endif
59
59
 
60
+ #if GLIB_CHECK_VERSION(2, 30, 0)
61
+ static VALUE
62
+ rbglib_m_format_size(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
63
+ {
64
+ VALUE rb_size, rb_options;
65
+
66
+ rb_scan_args(argc, argv, "11", &rb_size, &rb_options);
67
+ if (NIL_P(rb_options)) {
68
+ return CSTR2RVAL_FREE(g_format_size(NUM2UINT(rb_size)));
69
+ } else {
70
+ VALUE rb_flags;
71
+ rbg_scan_options(rb_options,
72
+ "flags", &rb_flags,
73
+ NULL);
74
+
75
+ return CSTR2RVAL_FREE(g_format_size_full(NUM2UINT(rb_size),
76
+ RVAL2GFORMATSIZEFLAGS(rb_flags)));
77
+ }
78
+ }
79
+ #endif
80
+
60
81
  void
61
82
  Init_glib_fileutils(void)
62
83
  {
@@ -91,4 +112,8 @@ Init_glib_fileutils(void)
91
112
  rbg_define_singleton_method(mGLib, "format_size_for_display",
92
113
  rbglib_m_format_size_for_display, 1);
93
114
  #endif
115
+ #if GLIB_CHECK_VERSION(2, 30, 0)
116
+ rbg_define_singleton_method(mGLib, "format_size",
117
+ rbglib_m_format_size, -1);
118
+ #endif
94
119
  }
@@ -63,6 +63,13 @@ rg_attach(int argc, VALUE *argv, VALUE self)
63
63
  RVAL2BOXED(context, G_TYPE_MAIN_CONTEXT)));
64
64
  }
65
65
 
66
+ static VALUE
67
+ rg_destroy(VALUE self)
68
+ {
69
+ g_source_destroy(_SELF(self));
70
+ return self;
71
+ }
72
+
66
73
  static VALUE
67
74
  rg_destroyed_p(VALUE self)
68
75
  {
@@ -101,6 +108,21 @@ rg_id(VALUE self)
101
108
  return UINT2NUM(g_source_get_id(_SELF(self)));
102
109
  }
103
110
 
111
+ #if GLIB_CHECK_VERSION(2, 26, 0)
112
+ static VALUE
113
+ rg_name(VALUE self)
114
+ {
115
+ return CSTR2RVAL(g_source_get_name(_SELF(self)));
116
+ }
117
+
118
+ static VALUE
119
+ rg_set_name(VALUE self, VALUE name)
120
+ {
121
+ g_source_set_name(_SELF(self), RVAL2CSTR(name));
122
+ return self;
123
+ }
124
+ #endif
125
+
104
126
  static VALUE
105
127
  rg_context(VALUE self)
106
128
  {
@@ -121,7 +143,7 @@ rg_set_callback(VALUE self)
121
143
  G_RELATIVE(self, func);
122
144
  g_source_set_callback(_SELF(self),
123
145
  (GSourceFunc)source_func,
124
- (gpointer)func,
146
+ (gpointer)func,
125
147
  (GDestroyNotify)NULL);
126
148
  return self;
127
149
  }
@@ -132,6 +154,23 @@ void g_source_set_callback_indirect (GSource *source,
132
154
  GSourceCallbackFuncs *callback_funcs);
133
155
  */
134
156
 
157
+ #if GLIB_CHECK_VERSION(2, 36, 0)
158
+ static VALUE
159
+ rg_ready_time(VALUE self)
160
+ {
161
+ gint64 ready_time;
162
+ ready_time = g_source_get_ready_time(_SELF(self));
163
+ return LL2NUM(ready_time);
164
+ }
165
+
166
+ static VALUE
167
+ rg_set_ready_time(VALUE self, VALUE ready_time)
168
+ {
169
+ g_source_set_ready_time(_SELF(self), NUM2LL(ready_time));
170
+ return self;
171
+ }
172
+ #endif
173
+
135
174
  static VALUE
136
175
  rg_add_poll(VALUE self, VALUE fd)
137
176
  {
@@ -166,7 +205,7 @@ gboolean g_source_remove_by_user_data (gpointer user_data);
166
205
  void
167
206
  Init_glib_source(void)
168
207
  {
169
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOURCE, "Source", mGLib);
208
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOURCE, "Source", mGLib);
170
209
 
171
210
  id_call = rb_intern("call");
172
211
 
@@ -176,14 +215,23 @@ Init_glib_source(void)
176
215
  "CONTINUE", CBOOL2RVAL(G_SOURCE_CONTINUE));
177
216
 
178
217
  RG_DEF_METHOD(attach, -1);
218
+ RG_DEF_METHOD(destroy, 0);
179
219
  RG_DEF_METHOD_P(destroyed, 0);
180
220
  RG_DEF_METHOD(set_priority, 1);
181
221
  RG_DEF_METHOD(priority, 0);
182
222
  RG_DEF_METHOD(set_can_recurse, 1);
183
223
  RG_DEF_METHOD_P(can_recurse, 0);
184
224
  RG_DEF_METHOD(id, 0);
225
+ #if GLIB_CHECK_VERSION(2, 26, 0)
226
+ RG_DEF_METHOD(name, 0);
227
+ RG_REPLACE_SET_PROPERTY(name, 1);
228
+ #endif
185
229
  RG_DEF_METHOD(context, 0);
186
230
  RG_DEF_METHOD(set_callback, 0);
231
+ #if GLIB_CHECK_VERSION(2, 36, 0)
232
+ RG_DEF_METHOD(ready_time, 0);
233
+ RG_REPLACE_SET_PROPERTY(ready_time, 1);
234
+ #endif
187
235
  RG_DEF_METHOD(add_poll, 1);
188
236
  RG_DEF_METHOD(remove_poll, 1);
189
237
  #if GLIB_CHECK_VERSION(2, 28, 0)
@@ -29,7 +29,7 @@ static VALUE
29
29
  rg_s_init(VALUE self)
30
30
  {
31
31
  #ifdef HAVE_G_THREAD_INIT
32
- #ifdef G_THREADS_ENABLED
32
+ #if defined(G_THREADS_ENABLED) && !GLIB_CHECK_VERSION(2, 32, 0)
33
33
  g_thread_init(NULL);
34
34
  #endif
35
35
  #endif
@@ -59,7 +59,7 @@ rg_s_getenv(G_GNUC_UNUSED VALUE self, VALUE variable)
59
59
  static VALUE
60
60
  rg_s_setenv(G_GNUC_UNUSED VALUE self, VALUE variable, VALUE value, VALUE overwrite)
61
61
  {
62
- return CBOOL2RVAL(g_setenv(RVAL2CSTR(variable),
62
+ return CBOOL2RVAL(g_setenv(RVAL2CSTR(variable),
63
63
  RVAL2CSTR_ACCEPT_NIL(value),
64
64
  RVAL2CBOOL(overwrite)));
65
65
  }
@@ -277,9 +277,9 @@ static VALUE
277
277
  rg_s_check_version_p(G_GNUC_UNUSED VALUE self, VALUE major, VALUE minor, VALUE micro)
278
278
  {
279
279
  return CBOOL2RVAL(glib_major_version > NUM2UINT(major) ||
280
- (glib_major_version == NUM2UINT(major) &&
280
+ (glib_major_version == NUM2UINT(major) &&
281
281
  glib_minor_version > NUM2UINT(minor)) ||
282
- (glib_major_version == NUM2UINT(major) &&
282
+ (glib_major_version == NUM2UINT(major) &&
283
283
  glib_minor_version == NUM2UINT(minor) &&
284
284
  glib_micro_version >= NUM2UINT(micro)));
285
285
  }
@@ -293,6 +293,11 @@ Init_glib_utils(void)
293
293
  G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_USER_DIRECTORY, "G_");
294
294
  #endif
295
295
 
296
+ #if GLIB_CHECK_VERSION(2, 30, 0)
297
+ G_DEF_CLASS(G_TYPE_FORMAT_SIZE_FLAGS,
298
+ "FormatSizeFlags", RG_TARGET_NAMESPACE);
299
+ #endif
300
+
296
301
  RG_DEF_SMETHOD(application_name, 0);
297
302
  RG_DEF_SMETHOD(set_application_name, 1);
298
303
  RG_DEF_SMETHOD(prgname, 0);
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2014 Ruby-GNOME2 Project Team
4
4
  * Copyright (C) 2006 Sjoerd Simons, Masao Mutoh
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -39,9 +39,9 @@ void
39
39
  Init_gobject_convert(void)
40
40
  {
41
41
  /* TODO: unref the below tables on exit. */
42
- tables = g_hash_table_new_full(g_int_hash, g_int_equal, NULL,
42
+ tables = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL,
43
43
  rg_convert_table_free);
44
- class_to_g_type_map = g_hash_table_new(g_int_hash, g_int_equal);
44
+ class_to_g_type_map = g_hash_table_new(g_direct_hash, g_direct_equal);
45
45
  }
46
46
 
47
47
  void
@@ -49,17 +49,20 @@ rbgobj_convert_define(const RGConvertTable *table)
49
49
  {
50
50
  RGConvertTable *copied_table;
51
51
  copied_table = g_memdup(table, sizeof(RGConvertTable));
52
- g_hash_table_insert(tables, &(copied_table->type), copied_table);
52
+ g_hash_table_insert(tables,
53
+ GUINT_TO_POINTER(copied_table->type),
54
+ copied_table);
53
55
  if (copied_table->klass != Qfalse && !NIL_P(copied_table->klass)) {
54
56
  g_hash_table_insert(class_to_g_type_map,
55
- &(copied_table->klass), &(copied_table->type));
57
+ GUINT_TO_POINTER(copied_table->klass),
58
+ GUINT_TO_POINTER(copied_table->type));
56
59
  }
57
60
  }
58
61
 
59
62
  RGConvertTable *
60
63
  rbgobj_convert_lookup(GType type)
61
64
  {
62
- return g_hash_table_lookup(tables, &type);
65
+ return g_hash_table_lookup(tables, GUINT_TO_POINTER(type));
63
66
  }
64
67
 
65
68
  gboolean
@@ -128,11 +131,11 @@ GType
128
131
  rbgobj_convert_rvalue2gtype(VALUE value)
129
132
  {
130
133
  VALUE klass;
131
- GType *result;
134
+ gpointer result;
132
135
 
133
136
  klass = rb_class_of(value);
134
- result = g_hash_table_lookup(class_to_g_type_map, &klass);
135
- return result ? *result : 0;
137
+ result = g_hash_table_lookup(class_to_g_type_map, GUINT_TO_POINTER(klass));
138
+ return GPOINTER_TO_UINT(result);
136
139
  }
137
140
 
138
141
  gboolean
@@ -91,29 +91,33 @@ module GLib
91
91
  private
92
92
 
93
93
  def const_missing(deprecated_const)
94
- if new_const = (@@deprecated_const[self] || {})[deprecated_const.to_sym]
95
- msg = "#{caller[0]}: '#{[name, deprecated_const].join('::')}' has been deprecated."
96
- case new_const
97
- when String, Symbol
98
- new_const_val = constant_get(new_const)
99
- case new_const_val
100
- when GLib::Enum, GLib::Flags
101
- alt = " or ':#{new_const_val.nick.gsub('-', '_')}'"
102
- end
103
- warn "#{msg} Use '#{new_const}'#{alt}."
104
- return const_set(deprecated_const, new_const_val)
105
- when Hash
106
- if new_const[:raise]
107
- raise DeprecatedError.new("#{msg} #{new_const[:raise]}")
108
- elsif new_const[:warn]
109
- warn "#{msg} #{new_const[:warn]}"
110
- else
111
- warn "#{msg} Don't use this constant anymore."
112
- end
113
- return
94
+ new_const = (@@deprecated_const[self] || {})[deprecated_const.to_sym]
95
+ if new_const.nil?
96
+ return super
97
+ end
98
+
99
+ msg = "#{caller[0]}: '#{[name, deprecated_const].join('::')}' has been deprecated."
100
+ case new_const
101
+ when String, Symbol
102
+ new_const_val = constant_get(new_const)
103
+ case new_const_val
104
+ when GLib::Enum, GLib::Flags
105
+ alt = " or ':#{new_const_val.nick.gsub('-', '_')}'"
106
+ end
107
+ warn "#{msg} Use '#{new_const}'#{alt}."
108
+ return const_set(deprecated_const, new_const_val)
109
+ when Hash
110
+ if new_const[:raise]
111
+ raise DeprecatedError.new("#{msg} #{new_const[:raise]}")
112
+ elsif new_const[:warn]
113
+ warn "#{msg} #{new_const[:warn]}"
114
+ else
115
+ warn "#{msg} Don't use this constant anymore."
114
116
  end
117
+ return
118
+ else
119
+ super
115
120
  end
116
- raise NameError.new("uninitialized constant #{[self, deprecated_const].join('::')}")
117
121
  end
118
122
 
119
123
  def constant_get(const)