diff options
Diffstat (limited to 'lib/rss/utils.rb')
-rw-r--r-- | lib/rss/utils.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/rss/utils.rb b/lib/rss/utils.rb new file mode 100644 index 000000000..32940cf2a --- /dev/null +++ b/lib/rss/utils.rb @@ -0,0 +1,19 @@ +module RSS + + module Utils + + def get_file_and_line_from_caller(i=0) + tmp = caller[i].split(':') + line = tmp.pop.to_i + file = tmp.join(':') + [file, line] + end + + def html_escape(s) + s.to_s.gsub(/&/, "&").gsub(/\"/, """).gsub(/>/, ">").gsub(/</, "<") + end + alias h html_escape + + end + +end |