aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2010-02-12 17:43:40 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2010-02-12 17:43:40 +0000
commit0180c114a6ec39ff9af10b537bb3562f25f74cf8 (patch)
treedf708d2e55fb19b3dc97ad6c8130d173be0d1e76
parenthtmlentities/string module is gone, removed by upstream. (diff)
downloadrbot-bugzilla-0180c114a6ec39ff9af10b537bb3562f25f74cf8.tar.gz
rbot-bugzilla-0180c114a6ec39ff9af10b537bb3562f25f74cf8.tar.bz2
rbot-bugzilla-0180c114a6ec39ff9af10b537bb3562f25f74cf8.zip
More fixup of htmlentities.
-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