From 0180c114a6ec39ff9af10b537bb3562f25f74cf8 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Fri, 12 Feb 2010 17:43:40 +0000 Subject: More fixup of htmlentities. --- bugzilla.rb | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/bugzilla.rb b/bugzilla.rb index 8fb235c..acf6a4a 100644 --- a/bugzilla.rb +++ b/bugzilla.rb @@ -17,20 +17,14 @@ require 'set' require 'rexml/document' require 'csv' +require 'htmlentities' -# Try loading htmlentities for entity expansion, but don't fail even -# if it's not available. -begin - require 'htmlentities' - - # If we don't have htmlentities extension available, replace - # decode_entities with a dummy function. - class String - def decode_entities - return HTMLEntities.decode(self) - end +module BugzillaStringExtensions + def decode_entities + return HTMLEntities.decode_entities(self) end end +String.send(:include, BugzillaStringExtensions) # Valid statuses # 'DONE' and 'OPEN' are special cases that expand to the rest of the statuses in that array -- cgit v1.2.3-65-gdbad