[#15357] Regexp literal and Regexp.new() — TAKAHASHI Masayoshi <maki@...>
高橋征義です。
高橋征義です。むーん、問題のありかが違ったかも。
まつもと ゆきひろです
[#15369] ruby_init_loadpath() on Windows — Shugo Maeda <shugo@...>
前田です。
わたなべです。
[#15395] UnboundMethod.bind to derived class instance — nobu.nakada@...
なかだです。
まつもと ゆきひろです
なかだです。
[#15410] pp - pretty printing — Tanaka Akira <akr@...17n.org>
さて、time.rb が片付いたので、次は pp.rb のご意見募集です。
In article <hvod71ntocb.fsf@coulee.a02.aist.go.jp>,
In article <hvo1yhuqhvk.fsf@coulee.a02.aist.go.jp>,
高橋征義です。
In article <20011224230059I.maki@rubycolor.org>,
[#15411] inconsistency of STR_ASSOC — "K.Kosako" <kosako@...>
Version : 1.7 latest (2001-12-10)
[#15418] block for MatchData#select, Hash#select — nobu.nakada@...
なかだです。
[#15430] [BUG] Segmentation fault/ruby 1.7.2 (2001-12-10) — WATANABE Tetsuya <tetsu@...>
渡辺哲也です。
[#15435] Time#utcoff — Tanaka Akira <akr@...17n.org>
In article <hvosnahj702.fsf@coulee.a02.aist.go.jp>,
まつもと ゆきひろです
わたなべです。
In article <1008292110.329151.8468.nullmailer@ev.netlab.jp>,
まつもと ゆきひろです
In article <1008320813.231850.10341.nullmailer@ev.netlab.jp>,
In article <hvosnaeblzu.fsf@coulee.a02.aist.go.jp>,
[#15441] exported symbol — nobu.nakada@...
なかだです。
[#15456] irb/completion で Segmentation fault — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
まつもと ゆきひろです
On Sat, 15 Dec 2001 18:28:12 +0900
まつもと ゆきひろです
[#15464] gsub weirdness: gsub(/.*$/, "foo") — "Akinori MUSHA" <knu@...>
なんか gsub がおかしいような気がするんですが、これはこういう
青山です。
At Mon, 17 Dec 2001 05:22:53 +0900,
[#15466] listen for sockets in both IPv4 and IPv6 — Ryo HAYASAKA <ryoh@...>
早坂@北陸先端です.
[#15479] [BUG] thread with tempfile.rb — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルソフトウェアです.
[#15500] Re: define_method() does not properly set noex (PR#218) — nobu.nakada@...
なかだです。
[#15505] ERb — m_seki@...
In article <20011220114249J.seki@mr.nasu.toshiba.co.jp>,
In article <m3eljr5o9m.wl@edwin.mva.biglobe.ne.jp>,
高橋征義です。
In article <20020215085405G.seki@mr.nasu.toshiba.co.jp>,
ただただしです。
まつもと ゆきひろです
新井です。
西山和広です。
>>>>> In [ruby-dev : No.15909]
まつもと ゆきひろです
なかだです。
まつもと ゆきひろです
なかだです。
At Mon, 18 Feb 2002 12:50:31 +0900,
なかだです。
In message <200202201003.g1KA3As11455@sharui.nakada.kanuma.tochigi.jp>
新井です。
あづみです。
[#15507] fileutils (2) — Minero Aoki <aamine@...>
あおきです。
高橋征義です。
あおきです。
高橋征義です。結論は最後に。
あおきです。
高橋征義です。
あおきです。
高橋征義です。
あおきです。
高橋征義です。
あおきです。
高橋征義です。
あおきです。
けいじゅ@日本ラショナルソフトウェアです.
[#15519] typo in tracer.rb (SCRIPT_LINES__) — sheepman <sheepman@...>
こんにちは。
なひです。
まつもと ゆきひろです
なひです。
[#15556] TCPSocket#open で Errno::EALREADY — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
[#15569] [REQ] File?chmod — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
[#15573] [patch] resolv.rb for win32 platform — Tietew <tietew-ml-ruby-dev@...>
Tietew です。
なかだです。
こんにちは、なかむら(う)です。
なかだです。
In message <20011228143615.32D8.TIETEW-ML-RUBY-DEV@tietew.net>
こんにちは、なかむら(う)です。
Tietew です。
[#15603] filename within eval — nobu.nakada@...
なかだです。
[ruby-dev:15435] Time#utcoff
In article <hvosnahj702.fsf@coulee.a02.aist.go.jp>,
Tanaka Akira <akr@m17n.org> writes:
> > おおっ、待ってるとパッチが来るのかしら。わくわく。
>
> それは速度以外では外部から観測不能なので、優先度は非常に低いです。
あれは Linux/Alpha で失敗することが判明したので優先度が上がりました...
が、それはそれとして
> 1. Time#utcoff の実装
です。
autoconf-2.52 前提であれば
AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include <time.h>])
で済むんですが。
(といいつつ 2.13 では試してないのでうまく動かないかも。)
Index: configure.in
===================================================================
RCS file: /src/ruby/configure.in,v
retrieving revision 1.103
diff -u -r1.103 configure.in
--- configure.in 2001/12/03 09:38:35 1.103
+++ configure.in 2001/12/13 18:31:03
@@ -302,6 +302,14 @@
getpgrp setpgrp getpgid setpgid getgroups getpriority getrlimit\
dlopen sigprocmask sigaction _setjmp setsid telldir seekdir fchmod)
AC_STRUCT_TIMEZONE
+AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
+ [AC_TRY_COMPILE([#include <time.h>],
+ [struct tm t; t.tm_gmtoff = 3600;],
+ [rb_cv_member_struct_tm_tm_gmtoff=yes],
+ [rb_cv_member_struct_tm_tm_gmtoff=no])])
+if test "$rb_cv_member_struct_tm_tm_gmtoff" = yes; then
+ AC_DEFINE(HAVE_STRUCT_TM_TM_GMTOFF)
+fi
AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
[AC_TRY_LINK([#include <time.h>
int i;],
Index: time.c
===================================================================
RCS file: /src/ruby/time.c,v
retrieving revision 1.47
diff -u -r1.47 time.c
--- time.c 2001/12/13 08:19:07 1.47
+++ time.c 2001/12/13 18:31:07
@@ -1071,6 +1071,48 @@
}
static VALUE
+time_utcoff(time)
+ VALUE time;
+{
+ struct time_object *tobj;
+
+ GetTimeval(time, tobj);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
+
+ if (tobj->gmt == 1) {
+ return INT2FIX(0);
+ }
+ else {
+#if defined(HAVE_STRUCT_TM_TM_GMTOFF)
+ return INT2NUM(tobj->tm.tm_gmtoff);
+#else
+ struct tm *u, *l;
+ time_t t;
+ int off;
+ l = &tobj->tm;
+ t = tobj->tv.tv_sec;
+ u = gmtime(&t);
+ if (!u)
+ rb_raise(rb_eArgError, "gmtime error");
+ if (l->tm_year != u->tm_year)
+ off = l->tm_year < u->tm_year ? -1 : 1;
+ else if (l->tm_mon != u->tm_mon)
+ off = l->tm_mon < u->tm_mon ? -1 : 1;
+ else if (l->tm_mday != u->tm_mday)
+ off = l->tm_mday < u->tm_mday ? -1 : 1;
+ else
+ off = 0;
+ off = off * 24 + l->tm_hour - u->tm_hour;
+ off = off * 60 + l->tm_min - u->tm_min;
+ off = off * 60 + l->tm_sec - u->tm_sec;
+ return INT2FIX(off);
+#endif
+ }
+}
+
+static VALUE
time_to_a(time)
VALUE time;
{
@@ -1315,6 +1357,8 @@
rb_define_method(rb_cTime, "isdst", time_isdst, 0);
rb_define_method(rb_cTime, "dst?", time_isdst, 0);
rb_define_method(rb_cTime, "zone", time_zone, 0);
+ rb_define_method(rb_cTime, "utcoff", time_utcoff, 0);
+ rb_define_method(rb_cTime, "gmtoff", time_utcoff, 0);
rb_define_method(rb_cTime, "utc?", time_utc_p, 0);
rb_define_method(rb_cTime, "gmt?", time_utc_p, 0);
--
[田中 哲][たなか あきら][Tanaka Akira]
「ふえろ! わかめちゃん作戦です$(C⊇」(Little Worker, 桂遊生丸)