diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-28 03:46:13 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-28 03:46:13 +0000 |
commit | 8640f16308dce0b013af0470b926956e676ccc1a (patch) | |
tree | 6262080bde1c6376c96bdc05d2a6692bd9de6818 /lib/rss/utils.rb | |
parent | 51e6d9061dc8090bd1c9e3a1a8dadbbd9294a48d (diff) |
* lib/rss: rss library imported. [ruby-dev:22726]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 0000000000..32940cf2a8 --- /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 |