зеркало из https://github.com/github/ruby.git
* lib/tempfile.rb: fix confusing inspect.
previous Tempfile#inspect says it is a File, but actually it is not a File. t = Tempfile.new("foo") #=> #<File:/tmp/foo20121106-31970-1ffbum0> t.is_a? File #=> false now Tempfile#inspect returns like: t = Tempfile.new("foo") #=> #<Tempfile:/tmp/foo20121106-31970-1ffbum0> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
e2418e3fca
Коммит
31f72cf518
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
Tue Nov 6 16:50:00 2012 Masaki Matsushita <glass.saga@gmail.com>
|
||||
|
||||
* lib/tempfile.rb (Tempfile#inspect): fix confusing #inspect.
|
||||
previous Tempfile#inspect says it is a File, but actually
|
||||
it is not a File.
|
||||
|
||||
t = Tempfile.new("foo") #=> #<File:/tmp/foo20121106-31970-1ffbum0>
|
||||
t.is_a? File #=> false
|
||||
|
||||
now Tempfile#inspect returns like:
|
||||
|
||||
t = Tempfile.new("foo")
|
||||
#=> #<Tempfile:/tmp/foo20121106-31970-1ffbum0>
|
||||
|
||||
Tue Nov 6 16:22:30 2012 Naohisa Goto <ngotogenome@gmail.com>
|
||||
|
||||
* atomic.h: add #include <sys/atomic.h> for the workaround of
|
||||
|
|
|
@ -261,6 +261,10 @@ class Tempfile < DelegateClass(File)
|
|||
end
|
||||
alias length size
|
||||
|
||||
def inspect
|
||||
"#<#{self.class}:#{path}>"
|
||||
end
|
||||
|
||||
# :stopdoc:
|
||||
class Remover
|
||||
def initialize(data)
|
||||
|
|
Загрузка…
Ссылка в новой задаче