Permalink
Browse files

Resolve an issue with JSON content and add test for it

  • Loading branch information...
1 parent 42d95ff commit 6d6a40db02d6e0453c7bbcb2997009863d4bed29 @bingos committed Dec 2, 2011
Showing with 9 additions and 238 deletions.
  1. +1 −0 .gitignore
  2. +0 −231 Changes
  3. +1 −1 Makefile.PL
  4. +1 −1 lib/App/CPANIDX.pm
  5. +1 −1 lib/App/CPANIDX/Queries.pm
  6. +2 −2 lib/App/CPANIDX/Renderer.pm
  7. +1 −1 lib/App/CPANIDX/Tables.pm
  8. +2 −1 t/01_renderer.t
View
1 .gitignore
@@ -0,0 +1 @@
+Changes
View
231 Changes
@@ -1,231 +0,0 @@
-==============================
-2011-01-03 14:33:44 +0000 0.30
-==============================
-
- commit 6ee72040120c5d4ec793f8fe40a25480e154d3f9
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Mon Jan 3 14:33:44 2011 +0000
-
- Sync up dist
-
- commit 0d291b19d24db8da6febd4e4162a2ec904a05ef1
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Mon Jan 3 14:32:19 2011 +0000
-
- Bump version to 0.30
-
- commit d5c8d61cb14f8e57a5f49d3f2b2bc4ec6a0d6bda
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Mon Jan 3 14:31:02 2011 +0000
-
- Fix schoolboy error
-
- commit e83f4c743592946f95ba60bff6801a619c267f5a
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Mon Jan 3 14:27:55 2011 +0000
-
- Make error handling more robust and add skip(core|mirrors|perms)
- options to cpanidx-gendb
-
-==============================
-2011-01-01 23:55:45 +0000 0.28
-==============================
-
- commit db1321ddf049fa7098bb040146863291cab8e38d
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Sat Jan 1 23:55:45 2011 +0000
-
- Update version to 0.28
-
- commit d602cfe7ed460983195fbdb922cf3982c99c7045
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Sat Jan 1 23:55:09 2011 +0000
-
- Update docs for new 'perms' query
-
- commit b0dbb8bebc893e117ad0887a1d87a4acb155a450
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Sat Jan 1 23:28:15 2011 +0000
-
- Added CPAN permissions data
-
- commit e479ffc864179bb586c0b7a825c03775368258b5
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Tue Nov 2 12:43:43 2010 +0000
-
- Post release changes
-
-==============================
-2010-11-02 12:40:45 +0000 0.26
-==============================
-
- commit 51cd6d674d301bd3c54a2b12c51883407608ee04
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Tue Nov 2 12:40:45 2010 +0000
-
- Bump version to 0.26
-
- commit 0fd43148a2638bb552a04e74e9d9f89c1bf75061
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Tue Nov 2 09:21:26 2010 +0000
-
- Extend size of dist_vers columns to handle 'withoutworldwriteables'
-
-==============================
-2010-09-06 15:15:43 +0100 0.24
-==============================
-
- commit 1b9b1bc8d7537a6c13388a5fe9518a6239e748f5
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Mon Sep 6 15:15:43 2010 +0100
-
- Added 'dist' query for querying distributions
-
-==============================
-2010-07-27 22:16:04 +0100 0.22
-==============================
-
- commit a505b717f380bf26ab6b39e01e9a72140982994c
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Tue Jul 27 22:16:04 2010 +0100
-
- Bump version to 0.22
-
- commit 561cbea48a6a103df47cdab8d80aa9bcc38eda7d
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Tue Jul 27 22:15:16 2010 +0100
-
- Make everything optional for cpanidx-gendb
-
-==============================
-2010-07-14 13:41:56 +0100 0.20
-==============================
-
- commit f619eba3589df527ea7fdfc04a0170da687835fd
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Wed Jul 14 13:41:56 2010 +0100
-
- Make the 'url' parameter optional for the cpanidx-gendb script
-
- commit 43fe7c2bb247b9fec0eb5e9a674bde3b4290b0e9
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Wed Jun 16 15:04:34 2010 +0100
-
- Write MYMETA.yml file.
-
-==============================
-2010-06-09 11:18:37 +0100 0.18
-==============================
-
- commit a46424ef7ea551a4046a8ef8e477a2b2be07900d
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Wed Jun 9 11:18:37 2010 +0100
-
- Added lastupdated to the timestamp table which is when the packages
- file we used was last updated
-
- commit 83de37da7ff5e452af3d866fed308c3c860b61ba
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Sun May 23 23:02:22 2010 +0100
-
- Sync
-
-==============================
-2010-05-06 10:41:11 +0100 0.16
-==============================
-
- commit 42fb2ad4995d70f43c35eb13e5a9fb9d377c4620
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Thu May 6 10:41:11 2010 +0100
-
- Added corelist functionality by integrating
- Module::CoreList::DBSchema
-
-==============================
-2010-04-19 16:00:33 +0100 0.14
-==============================
-
- commit ccbcab5dfc4abaacca913f1a9803fcfbdd63f8ff
- Author: Chris Williams <chris@bingosnet.co.uk>
- Date: Mon Apr 19 16:00:33 2010 +0100
-
- Version bump to 0.14
-
- commit 625574c6a1fa45f8759642b7cd1fa2241a95d2ed
- Author: Chris Williams <chris@bingosnet.co.uk>
- Date: Mon Apr 19 15:32:05 2010 +0100
-
- Added CPAN MIRRORED.BY support
-
-==============================
-2010-04-03 00:02:12 +0100 0.12
-==============================
-
- commit 6ef290644e646bd873102274c842d856b35f61d4
- Author: Chris Williams <chris@bingosnet.co.uk>
- Date: Sat Apr 3 00:02:12 2010 +0100
-
- Detect whether the dsn is SQLite and apply the PRAGMA appropriately.
-
-==============================
-2010-04-02 23:10:21 +0100 0.10
-==============================
-
- commit 300d14584aea5ba4165e451b8f920a4020586325
- Author: Chris Williams <chris@bingosnet.co.uk>
- Date: Fri Apr 2 23:10:21 2010 +0100
-
- Bump version
-
- commit d4d40db356c77c777978f8a9789409872c7fc09d
- Author: Chris Williams <chris@bingosnet.co.uk>
- Date: Fri Apr 2 23:07:07 2010 +0100
-
- Amended table tests
-
- commit ad81bcaa43975d4b03eb16ba96f65761bbc1271b
- Author: apocalypse <perl@0ne.us>
- Date: Fri Apr 2 22:53:08 2010 +0100
-
- Applied patches RT #56214 "cpanidx-gendb is slow when building the
- SQLite db"
-
-==============================
-2010-03-09 16:10:16 +0000 0.08
-==============================
-
- commit f7c6ccc2550d2fc7808346f11b9eb56eaa91f555
- Author: Chris Williams <chris@bingosnet.co.uk>
- Date: Tue Mar 9 16:10:16 2010 +0000
-
- Added App::CPANIDX::Renderer renderers() class method
-
-==============================
-2010-03-08 14:01:45 +0000 0.06
-==============================
-
- commit 3da66bd900c6462040b73b32ac27cc66fcd83a8f
- Author: Chris Williams <chris@bingosnet.co.uk>
- Date: Mon Mar 8 14:01:45 2010 +0000
-
- Added App::CPANIDX::Tables module
-
-==============================
-2010-03-05 22:48:51 +0000 0.04
-==============================
-
- commit e7cb1d37370638858d03b4f7d5b6919ee0eb340b
- Author: Chris Williams <chris@bingosnet.co.uk>
- Date: Fri Mar 5 22:48:51 2010 +0000
-
- Fixed compile error
-
- commit f96c1ab41925d8b12885d3c341539637b219e7a2
- Author: Chris Williams <chris@bingosnet.co.uk>
- Date: Fri Mar 5 22:39:03 2010 +0000
-
- Refactored stuff into modules
-
-==============
-End of Excerpt
-==============
View
2 Makefile.PL
@@ -20,7 +20,7 @@ requires 'File::Path' => '2.08';
requires 'File::Spec' => '3.31';
requires 'HTML::Tiny' => '1.05';
requires 'IO::Zlib' => '1.10';
-requires 'JSON::XS' => '2.27';
+requires 'JSON::XS' => '2.32';
requires 'Module::CoreList::DBSchema' => '0.06';
requires 'Parse::CPAN::MirroredBy' => '0.02';
requires 'URI' => '1.52';
View
2 lib/App/CPANIDX.pm
@@ -5,7 +5,7 @@ use warnings;
use vars qw($VERSION);
-$VERSION = '0.32';
+$VERSION = '0.34';
1;
View
2 lib/App/CPANIDX/Queries.pm
@@ -5,7 +5,7 @@ use warnings;
use Module::CoreList::DBSchema;
use vars qw[$VERSION];
-$VERSION = '0.32';
+$VERSION = '0.34';
my $mcdbs = Module::CoreList::DBSchema->new();
View
4 lib/App/CPANIDX/Renderer.pm
@@ -8,7 +8,7 @@ use XML::Simple;
use HTML::Tiny;
use vars qw[$VERSION];
-$VERSION = '0.32';
+$VERSION = '0.34';
my %types = (
'yaml', 'application/x-yaml; charset=utf-8',
@@ -27,7 +27,7 @@ my %renderers = (
'json', sub {
my $ref = shift;
my $string;
- eval { $string = JSON::XS->new->utf(1)->pretty(1)->encode( $ref ); };
+ eval { $string = JSON::XS->new->utf8(1)->pretty(1)->encode( $ref ); };
return $string;
},
'xml', sub {
View
2 lib/App/CPANIDX/Tables.pm
@@ -5,7 +5,7 @@ use warnings;
use Module::CoreList::DBSchema;
use vars qw[$VERSION];
-$VERSION = '0.32';
+$VERSION = '0.34';
my $mcdbs = Module::CoreList::DBSchema->new();
my %cl_tables = $mcdbs->tables();
View
3 t/01_renderer.t
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 9;
+use Test::More tests => 13;
use App::CPANIDX::Renderer;
my $data = [
@@ -28,4 +28,5 @@ foreach my $enc ( qw(yaml json xml html) ) {
isa_ok( $ren, 'App::CPANIDX::Renderer' );
my ($type,$content) = $ren->render('auth');
is( $type, $types{ $enc }, "$enc type is okay" );
+ ok( $content, "There is $type content" );
}

0 comments on commit 6d6a40d

Please sign in to comment.