public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/ag-web:master commit in: lib/
@ 2015-02-21 14:40 Alex Legler
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Legler @ 2015-02-21 14:40 UTC (permalink / raw
  To: gentoo-commits

commit:     15851c4bc5430a7b0f7d6a8af3a8b0522d672b60
Author:     Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Sat Feb 21 14:39:50 2015 +0000
Commit:     Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Sat Feb 21 14:39:50 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/ag-web.git;a=commit;h=15851c4b

Fix syntax error on ruby 2.0

---
 lib/index.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/index.rb b/lib/index.rb
index b4ad2b7..a50ba4c 100644
--- a/lib/index.rb
+++ b/lib/index.rb
@@ -57,7 +57,7 @@ def get_month_listing(list)
             field: 'month',
             size: 0,
             order: {
-              'month2': 'desc'
+              month2: 'desc'
             }
           },
           aggs: {


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/ag-web:master commit in: lib/
@ 2015-02-21 23:47 Robin H. Johnson
  0 siblings, 0 replies; 8+ messages in thread
From: Robin H. Johnson @ 2015-02-21 23:47 UTC (permalink / raw
  To: gentoo-commits

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

Optimize.

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

---
 lib/helpers.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/helpers.rb b/lib/helpers.rb
index e7050d1..5c3422e 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -4,7 +4,7 @@ require 'erb'
 
 helpers do
   def list_check
-    unless $config['active_lists'].include?(params[:list]) or $config['frozen_lists'].include?(params[:list])
+    unless [$config['active_lists'], $config['frozen_lists']].flatten.include?(params[:list])
       status 404
       body "List not found"
       return false


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/ag-web:master commit in: lib/
@ 2015-02-21 23:47 Robin H. Johnson
  0 siblings, 0 replies; 8+ messages in thread
From: Robin H. Johnson @ 2015-02-21 23:47 UTC (permalink / raw
  To: gentoo-commits

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/ag-web:master commit in: lib/
@ 2015-02-22  4:23 Robin H. Johnson
  0 siblings, 0 replies; 8+ messages in thread
From: Robin H. Johnson @ 2015-02-22  4:23 UTC (permalink / raw
  To: gentoo-commits

commit:     5a8cc4173b1544ed2ecc73191abceab2ad404d5a
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 22 04:22:33 2015 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Feb 22 04:22:47 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/ag-web.git;a=commit;h=5a8cc417

Correctly handle multiple email addreses being handed to the cleanup function.

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

---
 lib/helpers.rb | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/lib/helpers.rb b/lib/helpers.rb
index 3620d49..405975b 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -44,27 +44,31 @@ helpers do
   end
 
   def strip_email_domain(str)
-    str.gsub(/@(.*?)(>|$)/) do |s|
-      if $1 == 'gentoo.org'
-        "@g.o#{$2}"
-      elsif $1 == 'lists.gentoo.org'
-        "@l.g.o#{$2}"
-      else
-        "@#{'×' * $1.length}#{$2}"
+    str.split(/,\s*/).map do |email|
+      email.gsub(/@(.*?)(>|$)/) do |s|
+        if $1 == 'gentoo.org'
+          "@g.o#{$2}"
+        elsif $1 == 'lists.gentoo.org'
+          "@l.g.o#{$2}"
+        else
+          "@#{'×' * $1.length}#{$2}"
+        end
       end
-    end
+    end.join(', ')
   end
 
   def strip_email(str)
-    str.gsub(/([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+)\.([a-zA-Z]{2,10})/) do |email|
-      if $2 == 'gentoo' and $3 == 'org'
-        "#{$1}@g.o"
-      elsif $2 == 'lists.gentoo' and $3 == 'org'
-        "#{$1}@l.g.o"
-      else
-        "#{$1}@#{'×' * $2.length}.#{$3}"
+    str.split(/,\s*/).map do |email|
+      email.gsub(/([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+)\.([a-zA-Z]{2,10})/) do |s|
+        if $2 == 'gentoo' and $3 == 'org'
+          "#{$1}@g.o"
+        elsif $2 == 'lists.gentoo' and $3 == 'org'
+          "#{$1}@l.g.o"
+        else
+          "#{$1}@#{'×' * $2.length}.#{$3}"
+        end
       end
-    end
+    end.join(', ')
   end
 
   def linkize(str)


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/ag-web:master commit in: lib/
@ 2015-02-23 20:58 Alex Legler
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Legler @ 2015-02-23 20:58 UTC (permalink / raw
  To: gentoo-commits

commit:     2371c90f4f0d72eb9db29502599b78d9d2d0b0c4
Author:     Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Mon Feb 23 20:58:25 2015 +0000
Commit:     Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Mon Feb 23 20:58:25 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/ag-web.git;a=commit;h=2371c90f

All dates are UTC now, strip timezone

---
 lib/helpers.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/helpers.rb b/lib/helpers.rb
index 88b8f59..525dd93 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -22,7 +22,7 @@ helpers do
   end
 
   def date_format(date)
-    DateTime.iso8601(date).rfc2822
+    DateTime.iso8601(date).strftime('%a, %d %b %Y %T')
   end
 
   def to_monthint(year, month)


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/ag-web:master commit in: lib/
@ 2015-02-23 23:55 Alex Legler
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Legler @ 2015-02-23 23:55 UTC (permalink / raw
  To: gentoo-commits

commit:     52d5af6a47a6532575a3d3eef04bc4f7f3dbc7e4
Author:     Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Mon Feb 23 23:43:57 2015 +0000
Commit:     Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Mon Feb 23 23:43:57 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/ag-web.git;a=commit;h=52d5af6a

Better email escaping regex

---
 lib/helpers.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/helpers.rb b/lib/helpers.rb
index 5b4d2e3..6844e6d 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -45,7 +45,7 @@ helpers do
   # This method strips domains from header fields.
   def strip_email_headers(ary)
     [ary].flatten.map do |email|
-      email.gsub(/@(.*?)(>|$)/) do |s|
+      email.gsub(/@(\S*?)(>|$)/) do |s|
         if $1 == 'gentoo.org'
           "@g.o#{$2}"
         elsif $1 == 'lists.gentoo.org'


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/ag-web:master commit in: lib/
@ 2015-02-25 10:44 Alex Legler
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Legler @ 2015-02-25 10:44 UTC (permalink / raw
  To: gentoo-commits

commit:     ca2e544c70ac653b65038a60cd0db49983bed0cc
Author:     Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Wed Feb 25 10:34:43 2015 +0000
Commit:     Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Wed Feb 25 10:34:43 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/ag-web.git;a=commit;h=ca2e544c

Better email escape

---
 lib/helpers.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/helpers.rb b/lib/helpers.rb
index 6844e6d..987caeb 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -45,7 +45,7 @@ helpers do
   # This method strips domains from header fields.
   def strip_email_headers(ary)
     [ary].flatten.map do |email|
-      email.gsub(/@(\S*?)(>|$)/) do |s|
+      email.gsub(/@(\S*?)('|"|>|$)/) do |s|
         if $1 == 'gentoo.org'
           "@g.o#{$2}"
         elsif $1 == 'lists.gentoo.org'


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/ag-web:master commit in: lib/
@ 2015-02-25 14:19 Alex Legler
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Legler @ 2015-02-25 14:19 UTC (permalink / raw
  To: gentoo-commits

commit:     38ac05111cba0a13ab89228b17094da936f7c5ef
Author:     Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Wed Feb 25 14:19:41 2015 +0000
Commit:     Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Wed Feb 25 14:19:41 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/ag-web.git;a=commit;h=38ac0511

Display TLD in escaped header fields

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

diff --git a/lib/helpers.rb b/lib/helpers.rb
index 987caeb..873d50f 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -51,7 +51,8 @@ helpers do
         elsif $1 == 'lists.gentoo.org'
           "@l.g.o#{$2}"
         else
-          "@#{'×' * $1.length}#{$2}"
+          domain, dot, tld = $1.rpartition '.'
+          "@#{'×' * domain.length}.#{tld}#{$2}"
         end
       end
     end


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-02-25 14:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-23 23:55 [gentoo-commits] proj/ag-web:master commit in: lib/ Alex Legler
  -- strict thread matches above, loose matches on Subject: below --
2015-02-25 14:19 Alex Legler
2015-02-25 10:44 Alex Legler
2015-02-23 20:58 Alex Legler
2015-02-22  4:23 Robin H. Johnson
2015-02-21 23:47 Robin H. Johnson
2015-02-21 23:47 Robin H. Johnson
2015-02-21 14:40 Alex Legler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox