mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/date.rb (once): Use Object#object_id instead of Symbol#to_i;
backported from trunk besides the caching. * lib/erb.rb (ERB::Compiler::TrimScanner#scan): Use String#each_line instead of String#each. * rubytest.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
988ffd3c07
commit
eca3dd75c5
4 changed files with 15 additions and 5 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Wed Dec 17 20:06:32 2008 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* lib/date.rb (once): Use Object#object_id instead of Symbol#to_i;
|
||||
backported from trunk besides the caching.
|
||||
|
||||
* lib/erb.rb (ERB::Compiler::TrimScanner#scan): Use
|
||||
String#each_line instead of String#each.
|
||||
|
||||
* rubytest.rb: Ditto.
|
||||
|
||||
Wed Dec 17 19:53:48 2008 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* object.c (rb_any_to_a): Always use "... is deprecated" for a
|
||||
|
|
|
@ -1005,10 +1005,10 @@ class Date
|
|||
def once(*ids) # :nodoc:
|
||||
for id in ids
|
||||
module_eval <<-"end;"
|
||||
alias_method :__#{id.to_i}__, :#{id.to_s}
|
||||
private :__#{id.to_i}__
|
||||
alias_method :__#{id.object_id}__, :#{id.to_s}
|
||||
private :__#{id.object_id}__
|
||||
def #{id.to_s}(*args, &block)
|
||||
(@__#{id.to_i}__ ||= [__#{id.to_i}__(*args, &block)])[0]
|
||||
(@__#{id.object_id}__ ||= [__#{id.object_id}__(*args, &block)])[0]
|
||||
end
|
||||
end;
|
||||
end
|
||||
|
|
|
@ -304,7 +304,7 @@ class ERB
|
|||
def scan(&block)
|
||||
@stag = nil
|
||||
if @percent
|
||||
@src.each do |line|
|
||||
@src.each_line do |line|
|
||||
percent_line(line, &block)
|
||||
end
|
||||
else
|
||||
|
|
|
@ -37,7 +37,7 @@ $stderr.reopen($stdout)
|
|||
error = ''
|
||||
|
||||
srcdir = File.dirname(__FILE__)
|
||||
`#{ruby} -I#{srcdir}/lib #{srcdir}/sample/test.rb`.each do |line|
|
||||
`#{ruby} -I#{srcdir}/lib #{srcdir}/sample/test.rb`.each_line do |line|
|
||||
if line =~ /^end of test/
|
||||
print "test succeeded\n"
|
||||
exit 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue