[#19449] new keyword once — "K.Kosako" <kosako@...>
String#indexにKarp-Rabinアルゴリズムを導入しても、それほど速くならないのは、
[#19457] equality between "a" and Exception.new("a") — Tanaka Akira <akr@...17n.org>
ふと気がついたのですが、
まつもと ゆきひろです
In article <1044245817.592933.31973.nullmailer@picachu.netlab.jp>,
In article <1044245817.592933.31973.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
In article <1044329220.257740.28127.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
In article <1044331431.138035.28173.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
In article <1044332948.099873.28206.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
In article <1044338964.502066.28474.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
まつもと ゆきひろです
さらに気が付いたのですが、
まつもと ゆきひろです
あー、言葉が足りなかったことに気がつきました。
まつもと ゆきひろです
[#19463] Re: [ruby-cvs] ruby: * re.c (rb_memsearch): algolithm body of String#index. — "Akinori MUSHA" <knu@...>
At Mon, 3 Feb 2003 05:34:15 +0000,
[#19494] [Oniguruma] Version 1.7 — "K.Kosako" <kosako@...>
ftp.ruby-lang.orgに、onigd20030204.tar.gzを置きました。
[#19498] cpp in mkmf (Re: Problems building mysql ruby 2.4.4 on 1.8) — nobu.nakada@...
なかだです。
[#19510] define_method+super causes replacing self — Minero Aoki <aamine@...>
あおきです。
[#19514] [Oniguruma] Version 1.7.1 — "K.Kosako" <kosako@...>
ftp.ruby-lang.orgに、onigd20030207.tar.gzを置きました。
MoonWolfです。
MoonWolfです。
[#19539] FileUtils.pwd — Tanaka Akira <akr@...17n.org>
ふと気が付いたのですが、ChangeLog の
[#19548] [PATCH] file.c for (PR#389) and (PR#390) — nobu.nakada@...
なかだです。
まつもと ゆきひろです
From: nobu.nakada@nifty.ne.jp
なかだです。
From: nobu.nakada@nifty.ne.jp
From: pegacorn@jcom.home.ne.jp
[#19562] Fw: Ruby 1.8.0 bugs — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
MoonWolfです。
[#19578] target host type と RUBY_PLATFORM — pegacorn@...
cygwin 環境で
まつもと ゆきひろです
From: matz@ruby-lang.org (Yukihiro Matsumoto)
まつもと ゆきひろです
From: matz@ruby-lang.org (Yukihiro Matsumoto)
まつもと ゆきひろです
[#19603] 1.6.8でprotected/privateなメソッドがスコープ外から見えてしまう — NISHI Takao <zophos@...9.com>
にし@おかやまです。
[#19617] module A::B — "K.Kosako" <kosako@...>
現在の実装で、class A::Bの場合に、Aをcref環境に積まないのは、
[#19626] Re: [ruby-cvs] ruby: * eval.c (rb_thread_remove): thread may die in the process of — nobu.nakada@...
なかだです。
[#19638] [Oniguruma] Version 1.8.0 — "K.Kosako" <kosako@...>
ftp.ruby-lang.orgに、onigd20030222.tar.gzを置きました。
[#19648] Re: SEGV at search_method in eval.c (PR#400) — nobu.nakada@...
なかだです。
[#19655] Fw: Debugger Not Working — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
[#19665] Custom node — Shinya Hayakawa <tetryl@...>
はじめまして。早川と申します。
[#19668] File.chomp — Shin-ichiro HARA <sinara@...>
原です。
なかだです。
こんにちは、なかむら(う)です。
わたなべです。
[ruby-dev:19544] Re: FileUtils.pwd
なかだです。
At Sun, 9 Feb 2003 07:04:02 +0900,
Minero Aoki wrote:
> ついでと言ってはなんですが、FileUtils.pwd, cmp, identical?,
> uptodate? をオプションなしにしました。
cmp, copy_file, uptodate?あたりでファイル名以外(具体的にはIO,
Timeとか)を受け付けるようにするってのは、FileUtilsの主旨からは
外れてるでしょうか。これがあるとmkmf.rbからfileutils.rbを使うの
に都合がいいんですが。
Index: fileutils.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/fileutils.rb,v
retrieving revision 1.12
diff -u -2 -p -r1.12 fileutils.rb
--- fileutils.rb 8 Feb 2003 22:01:53 -0000 1.12
+++ fileutils.rb 9 Feb 2003 10:11:58 -0000
@@ -97,5 +97,5 @@ module FileUtils
#
- # Options: (none)
+ # Options: mtime
#
# Returns true if +newer+ is newer than all +old_list+.
@@ -103,14 +103,26 @@ module FileUtils
#
# FileUtils.uptodate? 'hello.o', %w(hello.c hello.h) or system 'make'
+ # FileUtils.uptodate? 'hello.o', 'hello.c', :mtime or system 'make'
#
def uptodate?( new, old_list, *options )
- raise ArgumentError, 'uptodate? does not accept any option' unless options.empty?
+ time, = fu_parseargs(options, :mtime)[0] ? :mtime : :ctime
- return false unless FileTest.exist? new
- new_time = File.ctime(new)
+ unless Time === new
+ return false unless FileTest.exist? new
+ new = File.__send__(time, new)
+ end
old_list.each do |old|
- if FileTest.exist? old
- return false unless new_time > File.mtime(old)
+ begin
+ old = Time.at(old)
+ rescue TypeError
+ if old.respond_to?(time)
+ old = old.__send__(time)
+ elsif FileTest.exist?(old)
+ old = File.__send__(time, old)
+ else
+ next
+ end
end
+ return false unless new > old
end
true
@@ -382,14 +394,27 @@ module FileUtils
def copy_file( src, dest ) #:nodoc:
- bsize = fu_blksize(File.stat(src).blksize)
- File.open(src, 'rb') {|r|
- File.open(dest, 'wb') {|w|
- begin
- while true
- w.syswrite r.sysread(bsize)
- end
- rescue EOFError
- end
- } }
+ if (r = src).respond_to?(:sysread)
+ r.pos += 0
+ else
+ r = File.open(src, 'rb')
+ end
+ if (w = dest).respond_to?(:syswrite)
+ w.pos += 0
+ else
+ w = File.open(dest, 'wb')
+ end
+ bsize = fu_blksize(case
+ when r.respond_to?(:stat)
+ r.stat.blksize
+ when w.respond_to?(:stat)
+ w.stat.blksize
+ end)
+ while true do
+ w.syswrite r.sysread(bsize)
+ end
+ rescue EOFError
+ ensure
+ w == dest or w.close if w
+ r == src or r.close
end
@@ -569,26 +594,40 @@ module FileUtils
sa = sb = nil
- st = File.stat(filea)
- bsize = fu_blksize(st.blksize)
- return false unless File.size(fileb) == st.size
-
- File.open(filea, 'rb') {|a|
- File.open(fileb, 'rb') {|b|
- begin
- while sa == sb
- sa = a.read(bsize)
- sb = b.read(bsize)
- unless sa and sb
- if sa.nil? and sb.nil?
- return true
- end
- end
- end
- rescue EOFError
- ;
- end
- } }
+ if (a = filea).respond_to?(:read)
+ a.pos += 0
+ else
+ a = File.open(filea, 'rb')
+ end
+ if (b = fileb).respond_to?(:read)
+ b.pos += 0
+ else
+ b = File.open(fileb, 'rb')
+ end
+ if a.respond_to?(:stat)
+ st = a.stat
+ sa = st.size
+ bsize = fu_blksize(st.blksize)
+ else
+ sa = a.size
+ end
+ if b.respond_to?(:stat)
+ st = b.stat
+ sb = st.size
+ bsize ||= fu_blksize(st.blksize)
+ else
+ sb = b.size
+ end
+ bsize ||= fu_blksize(nil)
+ return false unless sa == sb
- false
+ begin
+ sa = a.read(bsize)
+ sb = b.read(bsize)
+ return false unless sa == sb
+ end while sa
+ not sb
+ ensure
+ a == filea or a.close if a
+ b == fileb or b.close
end
@@ -755,5 +794,5 @@ module FileUtils
'symlink' => %w( force noop verbose ),
'touch' => %w( noop verbose ),
- 'uptodate?' => %w()
+ 'uptodate?' => %w( mtime )
}
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦