mirror of
https://github.com/gryf/gryf-overlay.git
synced 2025-12-20 04:48:00 +01:00
initial import
This commit is contained in:
27
dev-ruby/ruby-locale/files/ruby_locale_get_method.patch
Normal file
27
dev-ruby/ruby-locale/files/ruby_locale_get_method.patch
Normal file
@@ -0,0 +1,27 @@
|
||||
--- ruby-locale-0.2/rblocale.c 2000-04-14 06:20:58.000000000 +0200
|
||||
+++ ruby-locale-0.2_p/rblocale.c 2008-01-31 21:47:47.000000000 +0100
|
||||
@@ -31,6 +31,16 @@
|
||||
return ret == NULL ? Qnil : rb_str_new2(ret);
|
||||
}
|
||||
|
||||
+VALUE
|
||||
+locale_get( self, category )
|
||||
+ VALUE self, category;
|
||||
+{
|
||||
+ char *ret;
|
||||
+
|
||||
+ ret = setlocale(NUM2INT(category), NULL );
|
||||
+ return ret == NULL ? Qnil : rb_str_new2(ret);
|
||||
+}
|
||||
+
|
||||
void Init_locale()
|
||||
{
|
||||
char *curr_locale;
|
||||
@@ -44,6 +54,7 @@
|
||||
}
|
||||
|
||||
rb_define_module_function(mLocale, "set", locale_set, 2);
|
||||
+ rb_define_module_function(mLocale, "get", locale_get, 1);
|
||||
|
||||
rb_define_const(mLocale, "ALL", INT2FIX(LC_ALL));
|
||||
rb_define_const(mLocale, "COLLATE", INT2FIX(LC_COLLATE));
|
||||
Reference in New Issue
Block a user