lib/rio/ioh.rb in rio-0.3.4 vs lib/rio/ioh.rb in rio-0.3.6
- old
+ new
@@ -42,14 +42,15 @@
class Base
attr :ios
def initialize(ios,*args)
@ios = ios
end
- def initialize_copy(*args)
- #p callstr('ioh:initialize_copy',*args)
+ def initialize_copy(other)
+ #p callstr('ioh:initialize_copy',other)
super
- @ios = @ios.clone unless @ios.nil?
+ #p @ios
+ @ios = other.ios.clone unless other.ios.nil?
end
def callstr(func,*args)
self.class.to_s+'['+self.to_s+']'+'.'+func.to_s+'('+args.join(',')+')'
end
def handle() @ios end
@@ -94,9 +95,10 @@
:<<,:print,:printf,:puts,:putc,:write,:syswrite,
:pos,:pos=,:lineno,
:fileno,
:close_read,:close_write,
:fsync,:sync,:sync=,:fcntl,:ioctl)
+
def method_missing(sym,*args,&block)
#p callstr('method_missing',sym,*args)
handle.__send__(sym,*args,&block)
end
DEFAULT_BLKSIZE = 1024