You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2011/06/03 16:20:31 UTC

svn commit: r1131054 - /libcloud/site/trunk/lib/view.pm

Author: tomaz
Date: Fri Jun  3 14:20:31 2011
New Revision: 1131054

URL: http://svn.apache.org/viewvc?rev=1131054&view=rev
Log:
Rather use JSON::XS.

Modified:
    libcloud/site/trunk/lib/view.pm

Modified: libcloud/site/trunk/lib/view.pm
URL: http://svn.apache.org/viewvc/libcloud/site/trunk/lib/view.pm?rev=1131054&r1=1131053&r2=1131054&view=diff
==============================================================================
--- libcloud/site/trunk/lib/view.pm (original)
+++ libcloud/site/trunk/lib/view.pm Fri Jun  3 14:20:31 2011
@@ -34,7 +34,7 @@ use Carp;
 use Dotiac::DTL;
 use Dotiac::DTL::Addon::markup;
 use ASF::Util qw( read_text_file );
-use JSON;
+use JSON::XS;
 
 BEGIN { push @Dotiac::DTL::TEMPLATE_DIRS, "templates"; }
 
@@ -60,8 +60,7 @@ sub providers {
     my $filepath = "content$args{path}";
 
     read_text_file($filepath, \%args);
-    my $json = new JSON;
-    my %parsed = %{$json->utf8->decode($args{content})};
+    my %parsed = %{decode_json($args{content})};
     $args{providers} = $parsed;
 
     my $rendered = Dotiac::DTL->new($template_path)->render(\%parsed);