aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'bugzilla.rb')
-rw-r--r--bugzilla.rb16
1 files 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