2004-01-27 22:46:13 -05:00
|
|
|
module RSS
|
|
|
|
|
2004-10-16 00:51:15 -04:00
|
|
|
module Utils
|
2004-01-27 22:46:13 -05:00
|
|
|
|
2005-02-03 10:31:57 -05:00
|
|
|
module_function
|
|
|
|
def to_class_name(name)
|
|
|
|
name.split(/_/).collect do |part|
|
|
|
|
"#{part[0, 1].upcase}#{part[1..-1]}"
|
|
|
|
end.join("")
|
|
|
|
end
|
|
|
|
|
2004-10-16 00:51:15 -04:00
|
|
|
def get_file_and_line_from_caller(i=0)
|
|
|
|
file, line, = caller[i].split(':')
|
|
|
|
[file, line.to_i]
|
|
|
|
end
|
2004-01-27 22:46:13 -05:00
|
|
|
|
2004-10-16 00:51:15 -04:00
|
|
|
def html_escape(s)
|
|
|
|
s.to_s.gsub(/&/, "&").gsub(/\"/, """).gsub(/>/, ">").gsub(/</, "<")
|
|
|
|
end
|
|
|
|
alias h html_escape
|
|
|
|
|
|
|
|
end
|
2004-01-27 22:46:13 -05:00
|
|
|
|
|
|
|
end
|