Sha256: 128f671518304b568f2301064758367f30bbb61fcd28d5e6fd1d7333fa36388a
Contents?: true
Size: 551 Bytes
Versions: 30
Compression:
Stored size: 551 Bytes
Contents
#This class behaves like a normal thread - but it shows error-messages and tracebacks. Normal threads dont do that. class Knj::Thread < Thread attr_accessor :data def initialize(*args) @data = {} raise "No block was given." if !block_given? super(*args) do begin yield(*args) rescue SystemExit exit rescue Exception => e print Knj::Errors.error_str(e) end end end def [](key) return @data[key] end def []=(key, value) return @data[key] = value end end
Version data entries
30 entries across 30 versions & 1 rubygems