[#31927] Re: Problem with Ruby 1.8.6-p110 on DragonFly (was [PATCH] Problem with ruby 1.8.6-p36 (and p39) on Tiger) — Takahiro Kambe <taca@...>
こんばんは。
[#31928] securerandom.rb for 1.8 — Tanaka Akira <akr@...>
securerandom.rb を 1.8 に追加し、cgi/session.rb に使わせたい
At Wed, 3 Oct 2007 12:49:20 +0900,
In article <86k5pwinco.knu@iDaemons.org>,
-----BEGIN PGP SIGNED MESSAGE-----
まつもと ゆきひろです
-----BEGIN PGP SIGNED MESSAGE-----
まつもと ゆきひろです
-----BEGIN PGP SIGNED MESSAGE-----
[#31936] Rake添付 — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
-----BEGIN PGP SIGNED MESSAGE-----
まつもと ゆきひろです
Yukihiro Matsumoto さんは書きました:
-----BEGIN PGP SIGNED MESSAGE-----
NAKAMURA, Hiroshi さんは書きました:
At Wed, 10 Oct 2007 16:46:01 +0900,
-----BEGIN PGP SIGNED MESSAGE-----
[#31941] Re: [ruby-list:44071] Re: Ruby 1.8.6-p111 / 1.8.5-p114 released (Security Fix) — Shugo Maeda <shugo@...>
前田です。
-----BEGIN PGP SIGNED MESSAGE-----
前田です。
-----BEGIN PGP SIGNED MESSAGE-----
前田です。
In message <47063403.3070402@ruby-lang.org>,
In message <20071006.101915.596518898.gotoyuzo@sawara.priv.tokyo.netlab.jp>,
前田です。
In message <4709852A.1020606@ruby-lang.org>,
-----BEGIN PGP SIGNED MESSAGE-----
In message <470D9227.9090008@sarion.co.jp>,
-----BEGIN PGP SIGNED MESSAGE-----
[#31959] pcc: constant too big for cross-compiler — "NARUSE, Yui" <naruse@...>
成瀬です。
In article <470884D1.9040401@airemix.com>,
[#31980] multibyte string/regex literal with escape sequence — "U.Nakamura" <usa@...>
こんにちは、なかむら(う)です。
まつもと ゆきひろです
こんにちは、なかむら(う)です。
まつもと ゆきひろです
こんにちは、なかむら(う)です。
まつもと ゆきひろです
成瀬です。
こんにちは、なかむら(う)です。
In article <20071010091006.1988.USA@garbagecollect.jp>,
成瀬です。
In article <471003CB.7060701@airemix.com>,
成瀬です。
[#32049] Re: iconv enhancement in Ruby 1.9 — Nobuyoshi Nakada <nobu@...>
なかだです。
[#32133] undefined method `now' for DateTime:Class (NoMethodError) — "NAKAMURA, Hiroshi" <nakahiro@...>
-----BEGIN PGP SIGNED MESSAGE-----
どういう状況かよくわかってないのですが、いっそ必ず date 丸ごと読むようにするか、
-----BEGIN PGP SIGNED MESSAGE-----
> もしかして、単にtime.rbの「require 'parsedate'」を削ればいいだけだったり
-----BEGIN PGP SIGNED MESSAGE-----
> 確かに。で、1.9でparsedate.rbがなくなることを考えると、とりあえずtime.rb
In article <4b1598ce0710231835p1a0b3040kcc89bf0017a60c21@mail.gmail.com>,
[ruby-dev:32053] Process::Status#to_s
現在 Process::Status#to_s は整数な文字列を返します。
% ./ruby -e 'system("exit 1;"); p $?.to_s'
"256"
これはわかりにくいので以下のような文字列を返すのはどうでしょ
うか。
% ./ruby -e 'system("exit 1;"); p $?.to_s'
"pid 21978 exit 1"
signal で死んだ場合:
% ./ruby -e 'system("kill -ILL $$"); puts $?'
pid 7666 SIGILL (signal 4) (core dumped)
signal で止まった場合:
% ./ruby -e 'pid = spawn("kill -TSTP $$"); Process.waitpid pid, Process::WUNTRACED; puts $?'
pid 22014 stopped SIGTSTP (signal 20)
なお、メッセージの生成コードは inspect と共有しており、
inspect の結果も上記の形式を #<Process::Status: ...> で括っ
たものになります。
% ./ruby -e 'system("true"); p $?'
#<Process::Status: pid 7695 exit 0>
Index: process.c
===================================================================
--- process.c (リビジョン 13695)
+++ process.c (作業コピー)
@@ -248,20 +248,6 @@
/*
* call-seq:
- * stat.to_s => string
- *
- * Equivalent to _stat_<code>.to_i.to_s</code>.
- */
-
-static VALUE
-pst_to_s(VALUE st)
-{
- return rb_fix2str(pst_to_i(st), 10);
-}
-
-
-/*
- * call-seq:
* stat.pid => fixnum
*
* Returns the process ID that this status object represents.
@@ -277,34 +263,20 @@
return rb_iv_get(st, "pid");
}
-
-/*
- * call-seq:
- * stat.inspect => string
- *
- * Override the inspection method.
- */
-
-static VALUE
-pst_inspect(VALUE st)
+static void
+pst_message(VALUE str, rb_pid_t pid, int status)
{
- VALUE pid;
- int status;
- VALUE str;
char buf[256];
-
- pid = pst_pid(st);
- status = NUM2INT(st);
-
- str = rb_sprintf("#<%s: pid=%ld", rb_class2name(CLASS_OF(st)), NUM2LONG(pid));
+ snprintf(buf, sizeof(buf), "pid %ld", (long)pid);
+ rb_str_cat2(str, buf);
if (WIFSTOPPED(status)) {
int stopsig = WSTOPSIG(status);
const char *signame = ruby_signal_name(stopsig);
if (signame) {
- snprintf(buf, sizeof(buf), ",stopped(SIG%s=%d)", signame, stopsig);
+ snprintf(buf, sizeof(buf), " stopped SIG%s (signal %d)", signame, stopsig);
}
else {
- snprintf(buf, sizeof(buf), ",stopped(%d)", stopsig);
+ snprintf(buf, sizeof(buf), " stopped signal %d", stopsig);
}
rb_str_cat2(str, buf);
}
@@ -312,22 +284,67 @@
int termsig = WTERMSIG(status);
const char *signame = ruby_signal_name(termsig);
if (signame) {
- snprintf(buf, sizeof(buf), ",signaled(SIG%s=%d)", signame, termsig);
+ snprintf(buf, sizeof(buf), " SIG%s (signal %d)", signame, termsig);
}
else {
- snprintf(buf, sizeof(buf), ",signaled(%d)", termsig);
+ snprintf(buf, sizeof(buf), " signal %d", termsig);
}
rb_str_cat2(str, buf);
}
if (WIFEXITED(status)) {
- snprintf(buf, sizeof(buf), ",exited(%d)", WEXITSTATUS(status));
+ snprintf(buf, sizeof(buf), " exit %d", WEXITSTATUS(status));
rb_str_cat2(str, buf);
}
#ifdef WCOREDUMP
if (WCOREDUMP(status)) {
- rb_str_cat2(str, ",coredumped");
+ rb_str_cat2(str, " (core dumped)");
}
#endif
+}
+
+
+/*
+ * call-seq:
+ * stat.to_s => string
+ *
+ * Show pid and exit status as a string.
+ */
+
+static VALUE
+pst_to_s(VALUE st)
+{
+ rb_pid_t pid;
+ int status;
+ VALUE str;
+
+ pid = NUM2LONG(pst_pid(st));
+ status = NUM2INT(st);
+
+ str = rb_str_buf_new(0);
+ pst_message(str, pid, status);
+ return str;
+}
+
+
+/*
+ * call-seq:
+ * stat.inspect => string
+ *
+ * Override the inspection method.
+ */
+
+static VALUE
+pst_inspect(VALUE st)
+{
+ rb_pid_t pid;
+ int status;
+ VALUE str;
+
+ pid = NUM2LONG(pst_pid(st));
+ status = NUM2INT(st);
+
+ str = rb_sprintf("#<%s: ", rb_class2name(CLASS_OF(st)));
+ pst_message(str, pid, status);
rb_str_cat2(str, ">");
return str;
}
--
[田中 哲][たなか あきら][Tanaka Akira]