From: Hugh Sasse Date: 2006-07-19T02:04:43+09:00 Subject: Another look at RSS... I've had another look at lib/rss and the patch below is mostly doc changes, but I have also changed the method to_class_name. My testing with underscored names shows that it behaves the same, so hopefully I have not broken anything. I think the code is clearer. This is against: brains hgs 82 %> ls -ld stable-snapshot.tar.gz -rw-r--r-- 1 hgs staff 4467357 Jul 18 17:08 stable-snapshot.tar.gz brains hgs 83 %> md5sum !$ md5sum stable-snapshot.tar.gz a3bce2a5618af323c07ed68431ea1ef2 stable-snapshot.tar.gz brains hgs 84 %> HTH Hugh --- ./lib/rss/utils.rb.orig 2006-06-18 14:42:43.000000000 +0100 +++ ./lib/rss/utils.rb 2006-07-18 17:32:24.047018000 +0100 @@ -1,10 +1,10 @@ module RSS module Utils module_function + + # Convert a name_with_underscores to CamelCase. def to_class_name(name) - name.split(/_/).collect do |part| - "#{part[0, 1].upcase}#{part[1..-1]}" - end.join("") + name.split(/_/).collect{|part| part.capitalize}.join("") end def get_file_and_line_from_caller(i=0) @@ -12,11 +12,14 @@ [file, line.to_i] end + # escape '&', '"', '<' and '>' for use in HTML. def html_escape(s) s.to_s.gsub(/&/, "&").gsub(/\"/, """).gsub(/>/, ">").gsub(/