[Bps-public-commit] RT-Extension-rt_cpan_org branch, master, updated. a12663072cd643c2a6fa0ddcc5d5037acb30afe3

Thomas Sibley trs at bestpractical.com
Wed Aug 28 17:42:20 EDT 2013


The branch, master has been updated
       via  a12663072cd643c2a6fa0ddcc5d5037acb30afe3 (commit)
      from  3b5d80e577ae31436370317cb29aefa8df6487c7 (commit)

Summary of changes:
 bin/rt-cpan-bugs-per-dists | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit a12663072cd643c2a6fa0ddcc5d5037acb30afe3
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Aug 28 14:41:23 2013 -0700

    Export a JSON object ("dictionary") rather than array for easy lookup
    
    This avoids the need to scan the array in JS, as suggested by RJBS.
    
    Access logs claim that no one is using this export, so changing the
    format in-place is just fine.

diff --git a/bin/rt-cpan-bugs-per-dists b/bin/rt-cpan-bugs-per-dists
index 9581c51..ff9e703 100755
--- a/bin/rt-cpan-bugs-per-dists
+++ b/bin/rt-cpan-bugs-per-dists
@@ -89,7 +89,8 @@ sub write_tsv {
 
 sub write_json {
     my $data = shift;
+    my %data = map {; $_->{dist} => $_ } @$data;
     open my $fh,  ">", $json or die "unable to open $json for writing: $!";
-    print { $fh } encode_json($data), "\n";
+    print { $fh } encode_json(\%data), "\n";
     close $fh or die "couldn't close $json: $!";
 }

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list