Class: Knjappserver::CustomIO

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

Instance Method Summary collapse

Instance Method Details



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

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

#puts(str) ⇒ Object



14
15
16
17
18
# File 'lib/include/class_customio.rb', line 14

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