public
Rubygem
Description: Ramaze is a simple, light and modular open-source web application framework written in Ruby.
Homepage: http://ramaze.net
Clone URL: git://github.com/manveru/ramaze.git
Click here to lend your support to: ramaze and make a donation at www.pledgie.com !
Add Helper::Formatting::obfuscate_email
manveru (author)
Fri Jul 04 05:50:38 -0700 2008
commit  ae6a3afe5a12c2f8fa0b9e33d0ebc175316fc5bd
tree    d59781d09511557ed3b87e0ec8ca14a7dd382cac
parent  ff5343a81897548374fbb9e038ad268135d04016
...
114
115
116
 
 
 
 
 
 
 
117
118
...
114
115
116
117
118
119
120
121
122
123
124
125
0
@@ -114,5 +114,12 @@ module Ramaze
0
       br = xhtml ? '<br />' : '<br>'
0
       string.gsub(/\n/, br)
0
     end
0
+
0
+ # Maybe port to ruby < 1.8.7 ?
0
+ def obfuscate_email(string)
0
+ string = string.to_s
0
+ text = string.each_byte.map{|c| "&#%03d" % c}.join
0
+ %(<a href="mailto:#{string}">#{text}</a>)
0
+ end
0
   end
0
 end

Comments

    No one has commented yet.