handle bodies that do not respond to :close
commit7eb0c4e29e567f02affc202b51eb277cbae43688
authorEric Wong <normalperson@yhbt.net>
Wed, 9 Sep 2009 17:02:49 +0000 (9 10:02 -0700)
committerEric Wong <normalperson@yhbt.net>
Wed, 9 Sep 2009 17:09:57 +0000 (9 10:09 -0700)
tree59b2aa2efe2cc427cddc5638d1ccc152454419e8
parent72dfd64ed0ab31ced0f27e8a8a941c555221bb96
handle bodies that do not respond to :close

Since the wrapped Clogger object always responds to
close, we cannot blindly delegate the close method to
the body without ensuring it can be closed.  So ensure
that it can be closed before attempting to close it,
all return values and errors are trapped and returned.

Reported-by: IƱaki Baz Castillo
ext/clogger_ext/clogger.c
lib/clogger/pure.rb
test/test_clogger.rb