mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* gem_prelude.rb (push_all_highest_version_gems_on_load_path):
simplified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
270ece8441
commit
499bf746da
4 changed files with 15 additions and 33 deletions
|
@ -102,30 +102,17 @@ end
|
|||
#--
|
||||
# This class was added to flush out problems in Rubinius' IO implementation.
|
||||
|
||||
class TempIO
|
||||
|
||||
@@count = 0
|
||||
|
||||
class TempIO < Tempfile
|
||||
def initialize(string = '')
|
||||
@tempfile = Tempfile.new "TempIO-#{@@count += 1}"
|
||||
@tempfile.binmode
|
||||
@tempfile.write string
|
||||
@tempfile.rewind
|
||||
end
|
||||
|
||||
def method_missing(meth, *args, &block)
|
||||
@tempfile.send(meth, *args, &block)
|
||||
end
|
||||
|
||||
def respond_to?(meth)
|
||||
@tempfile.respond_to? meth
|
||||
super "TempIO"
|
||||
binmode
|
||||
write string
|
||||
rewind
|
||||
end
|
||||
|
||||
def string
|
||||
@tempfile.flush
|
||||
|
||||
Gem.read_binary @tempfile.path
|
||||
flush
|
||||
Gem.read_binary path
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue