Class: Hayabusa::Custom_io

Inherits:
StringIO
  • Object
show all
Defined in:
lib/hayabusa_custom_io.rb

Instance Method Summary collapse

Instance Method Details



2
3
4
5
6
7
8
9
10
11
# File 'lib/hayabusa_custom_io.rb', line 2

def print(str)
  str = str.to_s
  
  if appsrv = Thread.current[:hayabusa] and cgroup = appsrv[:contentgroup] and httpsession = appsrv[:httpsession]
    httpsession.add_size(str.size)
    cgroup.write(str)
  else
    STDOUT.print(str) if !STDOUT.closed?
  end
end

#puts(str) ⇒ Object



13
14
15
16
17
# File 'lib/hayabusa_custom_io.rb', line 13

def puts(str)
  res = self.print(str)
  self.print "\n"
  return res
end