raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: raindrops@librelist.org
Subject: [PATCH 2/3] watcher: sort index of listener listing
Date: Mon, 18 Jun 2012 14:20:44 -0700
Message-ID: <1340054445-29631-3-git-send-email-normalperson@yhbt.net> (raw)
In-Reply-To: <1340054445-29631-1-git-send-email-normalperson@yhbt.net>

For hosts with many listeners, it should be easier to read the
index page if the results are shown in a consistent order.

Requested privately via email to raindrops@bogomips.org
---
 lib/raindrops/watcher.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/raindrops/watcher.rb b/lib/raindrops/watcher.rb
index 869fa17..5493374 100644
--- a/lib/raindrops/watcher.rb
+++ b/lib/raindrops/watcher.rb
@@ -337,7 +337,9 @@ class Raindrops::Watcher
       "<table><tr>" \
         "<th>address</th><th>active</th><th>queued</th><th>reset</th>" \
       "</tr>" <<
-      all.map do |addr,stats|
+      all.sort do |a,b|
+        a[0] <=> b[0] # sort by addr
+      end.map do |addr,stats|
         e_addr = escape addr
         "<tr>" \
           "<td><a href='/tail/#{e_addr}.txt' " \
-- 
1.7.11.rc0.55.gb2478aa



  parent reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-18 21:20 [PATCH 0/3] preparing for raindrops 0.10.0 Eric Wong
2012-06-18 21:20 ` [PATCH 1/3] test_watcher: fix incorrect request/date comparison Eric Wong
2012-06-18 21:20 ` Eric Wong [this message]
2012-06-18 21:20 ` [PATCH 3/3] watcher: do not require Rack::Head for HEAD response Eric Wong

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://bogomips.org/raindrops/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340054445-29631-3-git-send-email-normalperson@yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=raindrops@librelist.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

raindrops RubyGem user+dev discussion/patches/pulls/bugs/help

Archives are clonable:
	git clone --mirror https://bogomips.org/raindrops-public
	git clone --mirror http://ou63pmih66umazou.onion/raindrops-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.raindrops
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.raindrops

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox