ports/68172: [PORT UPDATE] Ruby Locale interface: added Locale.get method
Alexander Novitsky
alecn2002 at yandex.ru
Mon Jun 21 17:00:58 UTC 2004
>Number: 68172
>Category: ports
>Synopsis: [PORT UPDATE] Ruby Locale interface: added Locale.get method
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Mon Jun 21 17:00:45 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Alexander Novitsky
>Release: FreeBSD 5.2-RELEASE i386
>Organization:
Inzhcomcentre VVD
>Environment:
System: FreeBSD server.v42of.icc-vvd.ru 5.2-RELEASE FreeBSD 5.2-RELEASE #0: Mon Mar 22 16:31:12 MSK 2004 alecn at server.v42of.icc-vvd.ru:/usr/src/sys/i386/compile/ORACLE i386
>Description:
Locale module didn't report current locale.
I've added module method Locale.get which
shows current settings of locale.
>How-To-Repeat:
#!/usr/local/bin/ruby
require "locale"
p Locale.set( Locale::ALL, "en_GB" ) # prints "en_GB"
p Locale.set( Locale::ALL, nil ) # should show current settings but set
# default locale ("C") instead of it
p Locale.get( Locale::ALL ) # New method, wasn' in prev version
>Fix:
--- ruby-locale.diff begins here ---
diff -ruN devel/ruby-locale/Makefile local/ruby-locale/Makefile
--- devel/ruby-locale/Makefile Tue Feb 18 08:04:56 2003
+++ local/ruby-locale/Makefile Mon Jun 21 20:41:48 2004
@@ -2,26 +2,25 @@
# Date created: 15 Aug 2000
# Whom: Akinori MUSHA aka knu <knu at idaemons.org>
#
-# $FreeBSD: ports/devel/ruby-locale/Makefile,v 1.8 2003/02/18 05:04:56 knu Exp $
+# $FreeBSD$
#
PORTNAME= locale
PORTVERSION= 0.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= devel ruby
MASTER_SITES= http://kafka.salemstate.edu/~yashi/ruby/
PKGNAMEPREFIX= ${RUBY_PKGNAMEPREFIX}
DISTNAME= ruby-${PORTNAME}-${PORTVERSION}
DIST_SUBDIR= ruby
-MAINTAINER= knu at FreeBSD.org
+MAINTAINER= alecn2002 at yandex.ru
COMMENT= A simple Ruby module that provides setlocale(3)
#USE_BZIP2= yes # only saves 500 bytes..
USE_RUBY= yes
USE_RUBY_EXTCONF= yes
-WRKSRC= ${WRKDIR}/${DISTNAME}
INSTALL_TARGET= site-install
post-install:
diff -ruN devel/ruby-locale/files/patch-ab local/ruby-locale/files/patch-ab
--- devel/ruby-locale/files/patch-ab Thu Jan 1 03:00:00 1970
+++ local/ruby-locale/files/patch-ab Mon Jun 21 20:36:45 2004
@@ -0,0 +1,27 @@
+--- rblocale.c.orig Fri Apr 14 08:20:58 2000
++++ rblocale.c Mon Jun 21 20:36:37 2004
+@@ -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));
--- ruby-locale.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list