Commits

Toby Inkster  committed b36f6b0

Ready for 0.101

  • Participants
  • Parent commits 35a9b88

Comments (0)

Files changed (20)

File Changes

-############################################################################
-## Changes #################################################################
-############################################################################
-
-JSON-T
-======
-
-Created:      2010-07-29
-Home page:    <http://search.cpan.org/dist/JSON-T/>
-Bug tracker:  <http://rt.cpan.org/Dist/Display.html?Queue=JSON-T>
-Maintainer:   Toby Inkster <mailto:tobyink@cpan.org>
-
-0.100 [2010-09-02]
- - Accept JSON::JOM as input to transformations.
-
-0.090_04 [2010-08-15]
- - Force stringification of return value of transform method. Pesky
-   JE::String values!
-
-0.090_03 [2010-08-10]
- - Additional debugging info added to tests.
-
-0.090_02 [2010-08-02]
- - Switched from JavaScript::SpiderMonkey to JE - SpiderMonkey version is
-   retained for those that want it.
-
-0.090_01 [2010-07-30]
- - (Bugfix) Non-JSON-string input for transform method was not being
-   correctly converted to JSON.
-
-0.090_00 [2010-07-30]
-

File Changes.ttl

-#############################################################
-
-@prefix :        <http://usefulinc.com/ns/doap#> .
-@prefix dcs:     <http://ontologi.es/doap-changeset#> .
-@prefix dc:      <http://purl.org/dc/terms/> .
-@prefix foaf:    <http://xmlns.com/foaf/0.1/> .
-@prefix my:      <http://purl.org/NET/cpan-uri/dist/JSON-T/> .
-@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix toby:    <http://tobyinkster.co.uk/#> .
-@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
-
-#############################################################
-
-<>
-
-	dc:title         "Changes" ;
-	dc:description   "Revision history for Perl extension JSON::T."@en ;
-	dc:subject       my:project ;
-	dc:creator       toby:i .
-
-#############################################################
-
-my:v_0-090_00
-
-	a               :Version ;
-	dc:issued       "2010-07-30"^^xsd:date ;
-	:revision       "0.090_00"^^xsd:string ;
-	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_00.tar.gz> ;
-	rdfs:comment    "Original version"@en .
-
-my:v_0-090_01
-
-	a               :Version ;
-	dc:issued       "2010-07-30"^^xsd:date ;
-	:revision       "0.090_01"^^xsd:string ;
-	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_01.tar.gz> ;
-	dcs:changeset [
-		dcs:versus my:v_0-090_00 ;
-		dcs:item   [ a dcs:Bugfix ; rdfs:label "Non-JSON-string input for transform method was not being correctly converted to JSON."@en ] 
-		] .
-
-my:v_0-090_02
-
-	a               :Version ;
-	dc:issued       "2010-08-02"^^xsd:date ;
-	:revision       "0.090_02"^^xsd:string ;
-	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_02.tar.gz> ;
-	dcs:changeset [
-		dcs:versus my:v_0-090_01 ;
-		dcs:item   [ rdfs:label "Switched from JavaScript::SpiderMonkey to JE - SpiderMonkey version is retained for those that want it."@en ] 
-		] .
-
-my:v_0-090_03
-
-	a               :Version ;
-	dc:issued       "2010-08-10"^^xsd:date ;
-	:revision       "0.090_03"^^xsd:string ;
-	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_03.tar.gz> ;
-	dcs:changeset [
-		dcs:versus my:v_0-090_02 ;
-		dcs:item   [ rdfs:label "Additional debugging info added to tests."@en ] 
-		] .
-
-my:v_0-090_04
-
-	a               :Version ;
-	dc:issued       "2010-08-15"^^xsd:date ;
-	:revision       "0.090_04"^^xsd:string ;
-	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_04.tar.gz> ;
-	dcs:changeset [
-		dcs:versus my:v_0-090_03 ;
-		dcs:item   [ rdfs:label "Force stringification of return value of transform method. Pesky JE::String values!"@en ] 
-		] .
-
-my:v_0-100
-
-	a               :Version ;
-	dc:issued       "2010-09-02"^^xsd:date ;
-	:revision       "0.100"^^xsd:string ;
-	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.100.tar.gz> ;
-	dcs:changeset [
-		dcs:versus my:v_0-090_04 ;
-		dcs:item   [ rdfs:label "Accept JSON::JOM as input to transformations."@en ] 
-		] .
-
-#############################################################
-
-my:project
-
-	a               :Project ;
-	:name           "JSON-T" ;
-	:shortdesc      "transform JSON using JsonT"@en ;
-	:programming-language  "Perl" ;
-	:homepage       <https://metacpan.org/release/JSON-T> ;
-	:download-page  <https://metacpan.org/release/JSON-T> ;
-	:bug-database   <http://rt.cpan.org/Dist/Display.html?Queue=JSON-T> ;
-	:repository     [ a :SVNRepository ; :browse <http://goddamn.co.uk/svn-web/perlmods/browse/JSON-T/> ] ;
-	:maintainer     toby:i ;
-	:developer      toby:i , [ a foaf:Person ; foaf:name "Stefan Goessner" ; foaf:homepage <http://goessner.net/> ] ;
-	:documenter     toby:i ;
-	:tester         toby:i ;
-	:created        "2010-07-29"^^xsd:date ;
-	:license        <http://creativecommons.org/licenses/LGPL/2.1/> ;
-	:release        my:v_0-090_00 , my:v_0-090_01 , my:v_0-090_02 , my:v_0-090_03 , my:v_0-090_04 ,
-	                my:v_0-100 .
-
-#############################################################
-
-toby:i
-
-	a               foaf:Person ;
-	foaf:name       "Toby Inkster" ;
-	foaf:homepage   <http://tobyinkster.co.uk/> ;
-	foaf:page       <https://metacpan.org/author/TOBYINK> ;
-	foaf:mbox       <mailto:tobyink@cpan.org> ;
-	<http://www.w3.org/2002/07/owl#sameAs> <http://purl.org/NET/cpan-uri/person/tobyink> .
-
-#############################################################

File Changes.xml

-<?xml version="1.0" encoding="utf-8"?>
-<rdf:RDF xmlns:dbug="http://ontologi.es/doap-bugs#" xmlns:dc="http://purl.org/dc/terms/" xmlns:dcs="http://ontologi.es/doap-changeset#" xmlns:doap="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
-<rdf:Description rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r0">
-	<dcs:item rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r1"/>
-	<dcs:versus rdf:resource="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_00"/>
-</rdf:Description>
-<rdf:Description rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r1">
-	<rdf:type rdf:resource="http://ontologi.es/doap-changeset#Bugfix"/>
-	<rdfs:label xml:lang="en">Non-JSON-string input for transform method was not being correctly converted to JSON.</rdfs:label>
-</rdf:Description>
-<rdf:Description rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r10">
-	<doap:browse rdf:resource="http://goddamn.co.uk/viewvc/perlmods/JSON-T/"/>
-	<rdf:type rdf:resource="http://usefulinc.com/ns/doap#SVNRepository"/>
-</rdf:Description>
-<rdf:Description rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r11">
-	<rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
-	<foaf:homepage rdf:resource="http://goessner.net/"/>
-	<foaf:name>Stefan Goessner</foaf:name>
-</rdf:Description>
-<rdf:Description rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r2">
-	<dcs:item rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r3"/>
-	<dcs:versus rdf:resource="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_01"/>
-</rdf:Description>
-<rdf:Description rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r3">
-	<rdfs:label xml:lang="en">Switched from JavaScript::SpiderMonkey to JE - SpiderMonkey version is retained for those that want it.</rdfs:label>
-</rdf:Description>
-<rdf:Description rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r4">
-	<dcs:item rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r5"/>
-	<dcs:versus rdf:resource="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_02"/>
-</rdf:Description>
-<rdf:Description rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r5">
-	<rdfs:label xml:lang="en">Additional debugging info added to tests.</rdfs:label>
-</rdf:Description>
-<rdf:Description rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r6">
-	<dcs:item rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r7"/>
-	<dcs:versus rdf:resource="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_03"/>
-</rdf:Description>
-<rdf:Description rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r7">
-	<rdfs:label xml:lang="en">Force stringification of return value of transform method. Pesky JE::String values!</rdfs:label>
-</rdf:Description>
-<rdf:Description rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r8">
-	<dcs:item rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r9"/>
-	<dcs:versus rdf:resource="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_04"/>
-</rdf:Description>
-<rdf:Description rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r9">
-	<rdfs:label xml:lang="en">Accept JSON::JOM as input to transformations.</rdfs:label>
-</rdf:Description>
-<rdf:Description rdf:about="file:///home/tai/src/perlmods/JSON-T/Changes.ttl">
-	<dc:creator rdf:resource="http://tobyinkster.co.uk/#i"/>
-	<dc:description xml:lang="en">Revision history for Perl extension JSON::T.</dc:description>
-	<dc:subject rdf:resource="http://purl.org/NET/cpan-uri/dist/JSON-T/project"/>
-	<dc:title>Changes</dc:title>
-</rdf:Description>
-<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/JSON-T/project">
-	<doap:bug-database rdf:resource="http://rt.cpan.org/Dist/Display.html?Queue=JSON-T"/>
-	<doap:created rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-07-29</doap:created>
-	<doap:developer rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r11"/>
-	<doap:developer rdf:resource="http://tobyinkster.co.uk/#i"/>
-	<doap:documenter rdf:resource="http://tobyinkster.co.uk/#i"/>
-	<doap:download-page rdf:resource="http://search.cpan.org/dist/JSON-T/"/>
-	<doap:homepage rdf:resource="http://search.cpan.org/dist/JSON-T/"/>
-	<doap:license rdf:resource="http://creativecommons.org/licenses/LGPL/2.1/"/>
-	<doap:maintainer rdf:resource="http://tobyinkster.co.uk/#i"/>
-	<doap:name>JSON-T</doap:name>
-	<doap:programming-language>Perl</doap:programming-language>
-	<doap:release rdf:resource="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_00"/>
-	<doap:release rdf:resource="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_01"/>
-	<doap:release rdf:resource="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_02"/>
-	<doap:release rdf:resource="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_03"/>
-	<doap:release rdf:resource="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_04"/>
-	<doap:release rdf:resource="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-100"/>
-	<doap:repository rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r10"/>
-	<doap:shortdesc xml:lang="en">transform JSON using JsonT</doap:shortdesc>
-	<doap:tester rdf:resource="http://tobyinkster.co.uk/#i"/>
-	<rdf:type rdf:resource="http://usefulinc.com/ns/doap#Project"/>
-</rdf:Description>
-<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_00">
-	<dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-07-30</dc:issued>
-	<doap:file-release rdf:resource="http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_00.tar.gz"/>
-	<doap:revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.090_00</doap:revision>
-	<rdf:type rdf:resource="http://usefulinc.com/ns/doap#Version"/>
-	<rdfs:comment xml:lang="en">Original version</rdfs:comment>
-</rdf:Description>
-<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_01">
-	<dcs:changeset rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r0"/>
-	<dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-07-30</dc:issued>
-	<doap:file-release rdf:resource="http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_01.tar.gz"/>
-	<doap:revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.090_01</doap:revision>
-	<rdf:type rdf:resource="http://usefulinc.com/ns/doap#Version"/>
-</rdf:Description>
-<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_02">
-	<dcs:changeset rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r2"/>
-	<dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-08-02</dc:issued>
-	<doap:file-release rdf:resource="http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_02.tar.gz"/>
-	<doap:revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.090_02</doap:revision>
-	<rdf:type rdf:resource="http://usefulinc.com/ns/doap#Version"/>
-</rdf:Description>
-<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_03">
-	<dcs:changeset rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r4"/>
-	<dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-08-10</dc:issued>
-	<doap:file-release rdf:resource="http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_03.tar.gz"/>
-	<doap:revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.090_03</doap:revision>
-	<rdf:type rdf:resource="http://usefulinc.com/ns/doap#Version"/>
-</rdf:Description>
-<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-090_04">
-	<dcs:changeset rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r6"/>
-	<dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-08-15</dc:issued>
-	<doap:file-release rdf:resource="http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_04.tar.gz"/>
-	<doap:revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.090_04</doap:revision>
-	<rdf:type rdf:resource="http://usefulinc.com/ns/doap#Version"/>
-</rdf:Description>
-<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/JSON-T/v_0-100">
-	<dcs:changeset rdf:nodeID="r1F3D755AB66911DF9A40E84A245C3046r8"/>
-	<dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-09-02</dc:issued>
-	<doap:file-release rdf:resource="http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.100.tar.gz"/>
-	<doap:revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.100</doap:revision>
-	<rdf:type rdf:resource="http://usefulinc.com/ns/doap#Version"/>
-</rdf:Description>
-<rdf:Description xmlns:ns1="http://www.w3.org/2002/07/owl#" rdf:about="http://tobyinkster.co.uk/#i">
-	<rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
-	<ns1:sameAs rdf:resource="http://purl.org/NET/cpan-uri/person/tobyink"/>
-	<foaf:homepage rdf:resource="http://tobyinkster.co.uk/"/>
-	<foaf:mbox rdf:resource="mailto:tobyink@cpan.org"/>
-	<foaf:name>Toby Inkster</foaf:name>
-	<foaf:page rdf:resource="http://search.cpan.org/~tobyink/"/>
-</rdf:Description>
-</rdf:RDF>

File MANIFEST.SKIP

-^MANIFEST.bak$
-^Makefile.old$
-^Makefile$
-^blib/
-^pm_to_blib
-^blibdirs
-\.svn
-^example.*\.pl$
-^[^/]+\.(tar\.gz|tar\.bz2|tgz|tbz2|tbz|zip|tar)$
-^MYMETA.yml

File META.yml

----
-abstract: 'transform JSON using JsonT'
-author:
-  - 'Toby Inkster <tobyink@cpan.org>'
-build_requires:
-  ExtUtils::MakeMaker: 6.42
-  Test::More: 0.61
-configure_requires:
-  ExtUtils::MakeMaker: 6.42
-distribution_type: module
-generated_by: 'Module::Install version 0.95'
-keywords:
-  - JSON
-  - transform
-  - JsonT
-  - Javascript
-license: lgpl
-meta-spec:
-  url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: 1.4
-name: JSON-T
-no_index:
-  directory:
-    - inc
-    - t
-requires:
-  JE: 0.049
-  JSON: 2.00
-  common::sense: 1.00
-  perl: 5.8.0
-resources:
-  bugtracker: http://rt.cpan.org/Dist/Display.html?Queue=JSON-T
-  homepage: http://search.cpan.org/dist/JSON-T/
-  license: http://opensource.org/licenses/lgpl-license.php
-  repository: http://goddamn.co.uk/viewvc/perlmods/JSON-T/
-version: 0.100
-use strict;
-use warnings;
+use inc::Module::Package 'RDF:standard 0.005';
 
-use inc::Module::Install;
-
-my $dist = 'JSON-T';
-my $fn   = "lib/$dist.pm"; $fn =~ s#-#/#g;
-
-name                $dist;
-perl_version_from   $fn;
-version_from        $fn;
-abstract_from       $fn;
-readme_from         $fn;
-author              'Toby Inkster <tobyink@cpan.org>';
-license             'lgpl';
-
-requires            'common::sense'      => '1.00';
-requires            'JE'                 => '0.049';
-requires            'JSON'               => '2.00';
-test_requires       'Test::More'         => '0.61';
-
-keywords 'JSON', 'transform', 'JsonT', 'Javascript';
-
-resources(
-	'homepage'   => "https://metacpan.org/release/$dist",
-	'repository' => "http://goddamn.co.uk/svn-web/perlmods/browse/$dist/",
-	'bugtracker' => "http://rt.cpan.org/Dist/Display.html?Queue=$dist",
-	);
-	
-write_doap_changes;
-write_doap_changes_xml;
-auto_license;
-auto_manifest;
-
-auto_install;
-WriteAll(
-	'meta' => 1,
-	'sign' => 1,
-	);

File README

-NAME
-    JSON::T - transform JSON using JsonT
-
-SYNOPSIS
-     my $jsont = slurp('foo/bar.js');
-     my $input = slurp('foo/quux.json');
-     my $JSONT = JSON::T->new($jsont);
-     print $JSONT->transform($input);
-
-DESCRIPTION
-    This module implements JsonT, a language for transforming JSON-like
-    structures, analogous to XSLT in the XML world.
-
-    JsonT is described at <http://goessner.net/articles/jsont/>. JsonT is a
-    profile of Javascript; this module uses the pure Perl Javascript
-    implementation JE for Javascript support. An alternative implementation
-    using Mozilla's libjs is provided as JSON::T::SpiderMonkey.
-
-    This module provides a similar API to XML::Saxon::XSLT2.
-
-Constructor
-    "JSON::T->new($code, $name)"
-        Constructs a new JSON::T transformation. $code is the JsonT
-        Javascript code. As a JsonT file can contain multiple (potentially
-        unrelated) transformations, the name of the particular
-        transformation you want to use should also be provided. If $name is
-        omitted, then the name "_main" is assumed.
-
-Methods
-    "parameters(param1=>$arg1, param2=>$arg2, ...)"
-        Sets global variables available to the Javascript code. All
-        arguments are treated as strings.
-
-    "transform($input)"
-        Run the transformation. The input may be a JSON string, a
-        JSON::JOM::Node or a native Perl nested arrayref/hashref structure,
-        in which case it will be stringified using the JSON module's to_json
-        function. The output (return value) will be a string.
-
-    "transform_structure($input)"
-        Like "transform", but attempts to parse the output as a JSON string
-        and return a native Perl arrayref/hashref structure. This method
-        will fail if the output is not a JSON string.
-
-Javascript Execution Environment
-    JSON::T is a profile of Javascript. This module runs scripts via JE. As
-    this is not a browser environment, many global objects familiar to
-    browser Javascript developers are not available.
-
-    A single global object called "JSON" is provided with methods
-    "stringify" and "parse" compatible with the well-known json2.js library
-    (<http://www.JSON.org/json2.js>), and a method "transform(obj,jsont)"
-    that provides a Javascript JsonT implementation.
-
-    A function "print_to_perl" is provided which prints to Perl's STDOUT
-    stream.
-
-BUGS
-    Please report any bugs to <http://rt.cpan.org/>.
-
-SEE ALSO
-    Specification: <http://goessner.net/articles/jsont/>.
-
-    Related modules: JSON, JSON::Path, JSON::GRDDL, JSON::Hyper,
-    JSON::Schema.
-
-    JOM version: JSON::JOM, JSON::JOM::Plugins::JsonT.
-
-    Requires: JSON, JE.
-
-AUTHOR
-    Toby Inkster <tobyink@cpan.org>.
-
-    This module is embeds Stefan Goessner's Javascript implementation of
-    JsonT (version 0.9) to do the heavy lifting.
-
-COPYRIGHT AND LICENCE
-    Copyright 2006 Stefan Goessner.
-
-    Copyright 2008-2010 Toby Inkster.
-
-    Licensed under the Lesser GPL:
-    <http://creativecommons.org/licenses/LGPL/2.1/>.
-

File TODO

-TODO:
-* Add some more items to this list.
-* Add keywords to Makefile.PL

File example1.pl

-use 5.010;
-use lib "lib";
-use Data::Dumper;
-use JSON;
-use JSON::JOM;
-use JSON::T;
-
-my $json = <<'JSON';
-{
-	"$transformation" : "http://buzzword.org.uk/2008/jsonGRDDL/jsont-sample#Person" ,
-	"name" : "Joe Bloggs" ,
-	"mbox" : "joe@example.net" 
-}
-JSON
-
-my $jsont = <<'JSONT';
-var namePrefix = "";
-
-var People =
-{
-	"self" : function(x)
-	{
-		var rv = {};
-		for (var i=0; x.people[i]; i++)
-		{
-			var person = JSON.parse(Person.self(x.people[i]));
-			rv["_:Contact" + i] = person["_:Contact"];
-		}
-		return JSON.stringify(rv, 0, 2);
-	}
-};
-
-var Person =
-{
-	"self" : function(x)
-	{
-		var rv =
-		{
-			"_:Contact" :
-			{
-				"http://www.w3.org/1999/02/22-rdf-syntax-ns#type" :
-				[{
-					"type" : "uri" ,
-					"value" : "http://xmlns.com/foaf/0.1/Person"
-				}],
-				"http://xmlns.com/foaf/0.1/name" :
-				[{
-					"type" : "literal" ,
-					"value" : namePrefix + x.name
-				}],
-				"http://xmlns.com/foaf/0.1/mbox" :
-				[{
-					"type" : "uri" ,
-					"value" : "mailto:" + x.mbox
-				}]
-			}
-		};
-		return JSON.stringify(rv, 0, 2);
-	}
-};
-
-var _main = Person;
-JSONT
-
-my $T = JSON::T->new($jsont);
-## $T->parameters(namePrefix => 'Mr ');
-say Dumper($T->transform_structure(JSON::JOM::from_json($json)));

File examples/example1.pl

+use 5.010;
+use JSON::JOM;
+use JSON::T;
+
+my $input = JSON::JOM::from_json(<<'JSON');
+{
+	"$transformation": "http://buzzword.org.uk/2008/jsonGRDDL/jsont-sample#Person",
+	"name": "Joe Bloggs",
+	"mbox": "joe@example.net" 
+}
+JSON
+
+my $transformation = <<'JSONT';
+var namePrefix = "";
+
+var People =
+{
+	"self" : function(x)
+	{
+		var rv = {};
+		for (var i=0; x.people[i]; i++)
+		{
+			var person = JSON.parse(Person.self(x.people[i]));
+			rv["_:Contact" + i] = person["_:Contact"];
+		}
+		return JSON.stringify(rv, 0, 2);
+	}
+};
+
+var Person =
+{
+	"self" : function(x)
+	{
+		var rv =
+		{
+			"_:Contact" :
+			{
+				"http://www.w3.org/1999/02/22-rdf-syntax-ns#type" :
+				[{
+					"type" : "uri" ,
+					"value" : "http://xmlns.com/foaf/0.1/Person"
+				}],
+				"http://xmlns.com/foaf/0.1/name" :
+				[{
+					"type" : "literal" ,
+					"value" : namePrefix + x.name
+				}],
+				"http://xmlns.com/foaf/0.1/mbox" :
+				[{
+					"type" : "uri" ,
+					"value" : "mailto:" + x.mbox
+				}]
+			}
+		};
+		return JSON.stringify(rv, 0, 2);
+	}
+};
+
+var _main = Person;
+JSONT
+
+my $T    = JSON::T->new($transformation);
+$T->parameters(namePrefix => 'Mr ');
+
+my $output = JSON::JOM::to_jom($T->transform_structure($input));
+
+say "#### $T";
+say $output->dump;

File lib/JSON/T.pm

 
 use 5.010;
 use common::sense;
-use overload '""' => \&_to_string;
+use utf8;
 
 use Class::Load qw[];
 use JSON qw[];
-use Object::AUTHORITY;
 use Scalar::Util qw[];
 
-our $JSLIB;
-our @Implementations;
+use Object::AUTHORITY;
+use overload '""' => \&_to_string;
 
 BEGIN
 {
-	push @Implementations, qw/JSON::T::JE JSON::T::SpiderMonkey/;
+	$JSON::T::AUTHORITY = 'cpan:TOBYINK';
+	$JSON::T::VERSION   = '0.101';
 }
 
+our ($JSLIB, @Implementations);
+
 sub _load_lib
 {
 	unless ($JSLIB)
 	}
 }
 
+BEGIN
+{
+	push @Implementations, qw/JSON::T::JE JSON::T::SpiderMonkey/;
+}
+
+sub DOES
+{
+	my ($class, $role) = @_;
+	return $role if $role eq 'XML::Saxon::XSLT2';
+	return $class->SUPER::DOES($role);
+}
+
 sub new
 {
 	my ($class, $transformation_code, $transformation_name) = @_;
 return a native Perl arrayref/hashref structure. This method will fail
 if the output is not a JSON string.
 
+=item C<< DOES($role) >>
+
+Like L<UNIVERSAL>'s DOES method, but returns true for:
+
+  JSON::T->DOES('XML::Saxon::XSLT2')
+
+as an aid for polymorphism.
+
 =back
 
 The following methods also exist for compatibility with XML::Saxon::XSLT2,
 
 =back
 
+You are unlikely to need to do anything else when subclassing.
+
 If you wish C<< JSON::T->new >> to know about your subclass, then push
 its name onto C<< @JSON::T::Implementations >>.
 

File lib/JSON/T/JE.pm

 
 use 5.010;
 use common::sense;
-use strict;
+use utf8;
 
 use JE;
-use JSON;
 
 use parent qw[JSON::T];
 
+BEGIN
+{
+	$JSON::T::JE::AUTHORITY = 'cpan:TOBYINK';
+	$JSON::T::JE::VERSION   = '0.101';
+}
+
 sub init
 {
 	my ($self, @args) = @_;
 
 This module uses L<JE> to provide JavaScript support.
 
+Implements:
+
+=over
+
+=item C<init>
+
+=item C<engine_eval>
+
+=item C<parameters>
+
+=back
+
 =head1 BUGS
 
 Please report any bugs to L<http://rt.cpan.org/>.

File lib/JSON/T/SpiderMonkey.pm

 package JSON::T::SpiderMonkey;
 
 use 5.010;
-use parent qw[JSON::T];
 use common::sense;
+use utf8;
 
 use JavaScript::SpiderMonkey;
-use JSON;
 
-our $VERSION = '0.100';
+use parent qw[JSON::T];
+
+BEGIN
+{
+	$JSON::T::SpiderMonkey::AUTHORITY = 'cpan:TOBYINK';
+	$JSON::T::SpiderMonkey::VERSION   = '0.101';
+}
 
 sub init
 {
 
 This module uses L<JavaScript::SpiderMonkey> to provide JavaScript support.
 
+Implements:
+
+=over
+
+=item C<init>
+
+=item C<engine_eval>
+
+=item C<parameters>
+
+=back
+
 =head1 BUGS
 
 Please report any bugs to L<http://rt.cpan.org/>.

File meta/changes.ttl

+@prefix :        <http://usefulinc.com/ns/doap#> .
+@prefix dcs:     <http://ontologi.es/doap-changeset#> .
+@prefix dc:      <http://purl.org/dc/terms/> .
+@prefix foaf:    <http://xmlns.com/foaf/0.1/> .
+@prefix my:      <http://purl.org/NET/cpan-uri/dist/JSON-T/> .
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix toby:    <http://tobyinkster.co.uk/#> .
+@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
+
+my:project :release my:v_0-090_00 .
+my:v_0-090_00
+	a               :Version ;
+	dc:issued       "2010-07-30"^^xsd:date ;
+	:revision       "0.090_00"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_00.tar.gz> ;
+	rdfs:comment    "Original version"@en .
+
+my:project :release my:v_0-090_01 .
+my:v_0-090_01
+	a               :Version ;
+	dc:issued       "2010-07-30"^^xsd:date ;
+	:revision       "0.090_01"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_01.tar.gz> ;
+	dcs:changeset [
+		dcs:versus my:v_0-090_00 ;
+		dcs:item   [ a dcs:Bugfix ; rdfs:label "Non-JSON-string input for transform method was not being correctly converted to JSON."@en ] 
+		] .
+
+my:project :release my:v_0-090_02 .
+my:v_0-090_02
+	a               :Version ;
+	dc:issued       "2010-08-02"^^xsd:date ;
+	:revision       "0.090_02"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_02.tar.gz> ;
+	dcs:changeset [
+		dcs:versus my:v_0-090_01 ;
+		dcs:item   [ rdfs:label "Switched from JavaScript::SpiderMonkey to JE - SpiderMonkey version is retained for those that want it."@en ] 
+		] .
+
+my:project :release my:v_0-090_03 .
+my:v_0-090_03
+	a               :Version ;
+	dc:issued       "2010-08-10"^^xsd:date ;
+	:revision       "0.090_03"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_03.tar.gz> ;
+	dcs:changeset [
+		dcs:versus my:v_0-090_02 ;
+		dcs:item   [ rdfs:label "Additional debugging info added to tests."@en ] 
+		] .
+
+my:project :release my:v_0-090_04 .
+my:v_0-090_04
+	a               :Version ;
+	dc:issued       "2010-08-15"^^xsd:date ;
+	:revision       "0.090_04"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.090_04.tar.gz> ;
+	dcs:changeset [
+		dcs:versus my:v_0-090_03 ;
+		dcs:item   [ rdfs:label "Force stringification of return value of transform method. Pesky JE::String values!"@en ] 
+		] .
+
+my:project :release my:v_0-100 .
+my:v_0-100
+	a               :Version ;
+	dc:issued       "2010-09-02"^^xsd:date ;
+	:revision       "0.100"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.100.tar.gz> ;
+	dcs:changeset [
+		dcs:versus my:v_0-090_04 ;
+		dcs:item   [ rdfs:label "Accept JSON::JOM as input to transformations."@en ] 
+		] .
+
+my:project :release my:v_0-101 .
+my:v_0-101
+	a               :Version ;
+	dc:issued       "2011-12-05"^^xsd:date ;
+	:revision       "0.101"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/JSON-T-0.101.tar.gz> ;
+	dcs:changeset [
+		dcs:versus my:v_0-100 ;
+		dcs:item   [ rdfs:label "Separate out the JE-specific stuff into JSON::T::JE."@en ] ;
+		dcs:item   [ rdfs:label "Create a clear division between the implementation-specific and more generic parts of the code. Document how to make implementation subclasses."@en ; a dcs:Documentation ] ;
+		dcs:item   [ rdfs:label "use 5.010"@en ; a dcs:Update ] ;
+		dcs:item   [ rdfs:label "Constructor uses Class::Load to load a suitable subclass."@en ] ;
+		dcs:item   [ rdfs:label "Module::Package::RDF"@en ; a dcs:Packaging ] ;
+		dcs:item   [ rdfs:label "use Object::AUTHORITY"@en ; a dcs:Update ] ;
+		dcs:item   [ rdfs:label "Provide a DOES method."@en ; a dcs:Addition ]
+		] .
+

File meta/doap.ttl

+@prefix :        <http://usefulinc.com/ns/doap#> .
+@prefix dcs:     <http://ontologi.es/doap-changeset#> .
+@prefix dc:      <http://purl.org/dc/terms/> .
+@prefix foaf:    <http://xmlns.com/foaf/0.1/> .
+@prefix my:      <http://purl.org/NET/cpan-uri/dist/JSON-T/> .
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix toby:    <http://tobyinkster.co.uk/#> .
+@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
+
+my:project
+	a               :Project ;
+	:name           "JSON-T" ;
+	:shortdesc      "transform JSON using JsonT"@en ;
+	:programming-language  "Perl", "Javascript" ;
+	:homepage       <https://metacpan.org/release/JSON-T> ;
+	:download-page  <https://metacpan.org/release/JSON-T> ;
+	:bug-database   <http://rt.cpan.org/Dist/Display.html?Queue=JSON-T> ;
+	:repository     [ a :HgRepository ; :browse <https://bitbucket.org/tobyink/p5-json-t> ] ;
+	:maintainer     toby:i ;
+	:developer      toby:i , [ a foaf:Person ; foaf:name "Stefan Goessner" ; foaf:homepage <http://goessner.net/> ] ;
+	:documenter     toby:i ;
+	:tester         toby:i ;
+	:created        "2010-07-29"^^xsd:date ;
+	:license        <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt> ;
+	:category
+		[ rdfs:label "JSON" ] ,
+		[ rdfs:label "Transform" ] ,
+		[ rdfs:label "JsonT" ] ,
+		[ rdfs:label "ECMAScript" ] ,
+		[ rdfs:label "JavaScript" ] .
+
+toby:i
+	a               foaf:Person ;
+	foaf:name       "Toby Inkster" ;
+	foaf:homepage   <http://tobyinkster.co.uk/> ;
+	foaf:page       <https://metacpan.org/author/TOBYINK> ;
+	foaf:mbox       <mailto:tobyink@cpan.org> ;
+	<http://www.w3.org/2002/07/owl#sameAs> <http://purl.org/NET/cpan-uri/person/tobyink> .

File meta/makefile.ttl

+# This file provides instructions for packaging.
+
+@prefix : <http://purl.org/NET/cpan-uri/terms#> .
+
+<http://purl.org/NET/cpan-uri/dist/JSON-T/project>
+	:perl_version_from _:main ;
+	:version_from _:main ;
+	:readme_from _:main ;
+	:test_requires "Test::More 0.61" ;
+	:recommends "JavaScript::SpiderMonkey" ;
+	:requires "JSON" , "JE" , "Class::Load", "common::sense" , "Scalar::Util", "Object::AUTHORITY".
+
+_:main <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName> "lib/JSON/T.pm" .
+
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();
+

File xt/02pod_coverage.t

+use Test::More;
+use Test::Pod::Coverage;
+
+my @modules = qw(JSON::T JSON::T::JE JSON::T::SpiderMonkey);
+pod_coverage_ok($_, "$_ is covered")
+	foreach @modules;
+done_testing(scalar @modules);
+

File xt/03meta_uptodate.t

+use Test::More tests => 1;
+use Test::RDF::DOAP::Version;
+doap_version_ok('JSON-T', 'JSON::T');
+
+use Test::EOL;
+all_perl_files_ok();