commit:     882561f27f001ee0ee67ea43df422a87ef1c4944
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 21 23:45:43 2015 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Feb 21 23:45:43 2015 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/ag-web.git;a=commit;h=882561f2

More helper.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

---
 lib/helpers.rb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/helpers.rb b/lib/helpers.rb
index fe0083a..e7050d1 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -1,5 +1,6 @@
 require 'date'
 require 'rinku'
+require 'erb'
 
 helpers do
   def list_check
@@ -35,6 +36,10 @@ helpers do
     Rack::Utils.escape_html(text)
   end
 
+  def u(text)
+    ERB::Util::url_encode(text)
+  end
+
   def strip_email_domain(str)
     str.gsub(/@(.*?)(>|$)/) do |s|
       if $1 == 'gentoo.org'
@@ -64,4 +69,4 @@ helpers do
   end
 
 
-end
\ No newline at end of file
+end

Reply via email to