File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ def append_as_bytes(string)
37
37
end
38
38
end
39
39
40
- alias_method :concat , :append_as_bytes
41
- alias_method :<< , :append_as_bytes
40
+ undef_method :concat
41
+ undef_method :<<
42
42
end
43
43
44
44
##
@@ -73,7 +73,7 @@ def initialize(*)
73
73
74
74
def fill_rbuff
75
75
begin
76
- @rbuffer << self . sysread ( BLOCK_SIZE )
76
+ @rbuffer . append_as_bytes ( self . sysread ( BLOCK_SIZE ) )
77
77
rescue Errno ::EAGAIN
78
78
retry
79
79
rescue EOFError
@@ -450,10 +450,10 @@ def <<(s)
450
450
def puts ( *args )
451
451
s = Buffer . new
452
452
if args . empty?
453
- s << "\n "
453
+ s . append_as_bytes ( "\n " )
454
454
end
455
455
args . each { |arg |
456
- s << arg . to_s
456
+ s . append_as_bytes ( arg . to_s )
457
457
s . sub! ( /(?<!\n )\z / , "\n " )
458
458
}
459
459
do_write ( s )
@@ -467,7 +467,7 @@ def puts(*args)
467
467
468
468
def print ( *args )
469
469
s = Buffer . new
470
- args . each { |arg | s << arg . to_s }
470
+ args . each { |arg | s . append_as_bytes ( arg . to_s ) }
471
471
do_write ( s )
472
472
nil
473
473
end
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def sysread(size)
31
31
end
32
32
33
33
def syswrite ( str )
34
- @io << str
34
+ @io . append_as_bytes ( str )
35
35
str . size
36
36
end
37
37
end
You can’t perform that action at this time.
0 commit comments