[libnet-openid-common-perl] 01/03: remove unnecessary json encoding stuff

gregor herrmann gregoa at debian.org
Sun Feb 7 21:50:22 UTC 2016


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to annotated tag v1.030099_003
in repository libnet-openid-common-perl.

commit a1a117cacb59a9453a227281bfabae6d500639f8
Author: Robert Norris <rob at eatenbyagrue.org>
Date:   Sat Jan 1 12:34:06 2011 +1100

    remove unnecessary json encoding stuff
---
 Changes                  |  3 +++
 lib/Net/OpenID/Common.pm | 29 -----------------------------
 t/07-ejs.t               | 13 -------------
 3 files changed, 3 insertions(+), 42 deletions(-)

diff --git a/Changes b/Changes
index 08e6517..51326cc 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 {{$NEXT}}
 
+    * Removed JSON encoder in favour of using JSON::encode_json directly in
+      N::O::Server and N::O::Consumer (Robert Norris)
+
 1.030099_002 Dec 07 2010
 
     * Documentation tweaks (Robert Norris)
diff --git a/lib/Net/OpenID/Common.pm b/lib/Net/OpenID/Common.pm
index bcb8ed4..7f3e7c0 100644
--- a/lib/Net/OpenID/Common.pm
+++ b/lib/Net/OpenID/Common.pm
@@ -66,35 +66,6 @@ sub parse_keyvalue {
     return %ret;
 }
 
-sub ejs
-{
-    my $a = $_[0];
-    $a =~ s/([\"\'\\])/\\$1/g;
-    $a =~ s/\r?\n/\\n/gs;
-    $a =~ s/\r//;
-    return $a;
-}
-
-# Data::Dumper for JavaScript
-sub js_dumper {
-    my $obj = shift;
-    if (ref $obj eq "HASH") {
-        my $ret = "{";
-        foreach my $k (keys %$obj) {
-            $ret .= "$k: " . js_dumper($obj->{$k}) . ",";
-        }
-        chop $ret;
-        $ret .= "}";
-        return $ret;
-    } elsif (ref $obj eq "ARRAY") {
-        my $ret = "[" . join(", ", map { js_dumper($_) } @$obj) . "]";
-        return $ret;
-    } else {
-        return $obj if $obj =~ /^\d+$/;
-        return "\"" . ejs($obj) . "\"";
-    }
-}
-
 sub eurl
 {
     my $a = $_[0];
diff --git a/t/07-ejs.t b/t/07-ejs.t
deleted file mode 100644
index 5326ef0..0000000
--- a/t/07-ejs.t
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/perl
-    
-use strict;
-use Test::More tests => 1;
-use Net::OpenID::Common;
-
-my @escapes = qw(
-    "'\\    \"\'\\\\
-);
-
-while ( my ($before, $after) = splice @escapes, 0, 2 ) {
-    is ( $after, OpenID::util::ejs($before) );
-}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-openid-common-perl.git



More information about the Pkg-perl-cvs-commits mailing list