lib/knj/objects.rb in knjrbfw-0.0.41 vs lib/knj/objects.rb in knjrbfw-0.0.42
- old
+ new
@@ -16,11 +16,11 @@
@objects = {}
@locks = {}
@data = {}
@lock_require = Monitor.new
- require "wref" if @args[:cache] == :weak
+ require "wref" if @args[:cache] == :weak and !Kernel.const_defined?(:Wref)
#Set up various events.
@events = Knj::Event_handler.new
@events.add_event(:name => :no_html, :connections_max => 1)
@events.add_event(:name => :no_name, :connections_max => 1)
@@ -495,10 +495,10 @@
objhtml = ""
end
raise "Could not figure out which name-method to call?" if !objhtml
html << ">#{objhtml}</option>"
- rescue Exception => e
+ rescue => e
html << ">[#{object.class.name}: #{e.message}]</option>"
end
end
return html
\ No newline at end of file