Sha256: 583cfcedee4b3d7c4580763774e919883c6d084b0d1e34d4354d9287a4c4083e

Contents?: true

Size: 397 Bytes

Versions: 10

Compression:

Stored size: 397 Bytes

Contents

class Knjappserver::CustomIO < StringIO
	def print(str)
		str = str.to_s
		appsrv = Thread.current[:knjappserver]
		
    if appsrv 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
	
	alias << print
	alias write print
	alias p print
	alias puts print
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
knjappserver-0.0.26 lib/include/class_customio.rb
knjappserver-0.0.25 lib/include/class_customio.rb
knjappserver-0.0.24 lib/include/class_customio.rb
knjappserver-0.0.23 lib/include/class_customio.rb
knjappserver-0.0.22 lib/include/class_customio.rb
knjappserver-0.0.21 lib/include/class_customio.rb
knjappserver-0.0.20 lib/include/class_customio.rb
knjappserver-0.0.19 lib/include/class_customio.rb
knjappserver-0.0.18 lib/include/class_customio.rb
knjappserver-0.0.17 lib/include/class_customio.rb