Sha256: f468900cdeda60611078315ea54a40574d7b21d957ae46a09184882fd77be241

Contents?: true

Size: 466 Bytes

Versions: 26

Compression:

Stored size: 466 Bytes

Contents

class Hayabusa::Custom_io < StringIO
  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
  
  def puts(str)
    res = self.print(str)
    self.print "\n"
    return res
  end
  
  alias << print
  alias write print
  alias p print
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
hayabusa-0.0.6 lib/hayabusa_custom_io.rb
hayabusa-0.0.5 lib/hayabusa_custom_io.rb
hayabusa-0.0.4 lib/hayabusa_custom_io.rb
hayabusa-0.0.3 lib/hayabusa_custom_io.rb
hayabusa-0.0.2 lib/hayabusa_custom_io.rb
hayabusa-0.0.1 lib/hayabusa_custom_io.rb