Build.PL1007551073730013260624 351312563056503 20740 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07# ========================================================================= # THIS FILE IS AUTOMATICALLY GENERATED BY MINILLA. # DO NOT EDIT DIRECTLY. # ========================================================================= use 5.008_001; use strict; use warnings; use utf8; use Module::Build; use File::Basename; use File::Spec; use CPAN::Meta; use CPAN::Meta::Prereqs; my %args = ( license => 'perl', dynamic_config => 0, configure_requires => { 'Module::Build' => 0.38, }, name => 'JSON-Pointer', module_name => 'JSON::Pointer', allow_pureperl => 0, script_files => [glob('script/*'), glob('bin/*')], c_source => [qw()], PL_files => {}, test_files => ((-d '.git' || $ENV{RELEASE_TESTING}) && -d 'xt') ? 't/ xt/' : 't/', recursive_test_files => 1, ); if (-d 'share') { $args{share_dir} = 'share'; } my $builder = Module::Build->subclass( class => 'MyBuilder', code => q{ sub ACTION_distmeta { die "Do not run distmeta. Install Minilla and `minil install` instead.\n"; } sub ACTION_installdeps { die "Do not run installdeps. Run `cpanm --installdeps .` instead.\n"; } } )->new(%args); $builder->create_build_script(); my $mbmeta = CPAN::Meta->load_file('MYMETA.json'); my $meta = CPAN::Meta->load_file('META.json'); my $prereqs_hash = CPAN::Meta::Prereqs->new( $meta->prereqs )->with_merged_prereqs( CPAN::Meta::Prereqs->new($mbmeta->prereqs) )->as_string_hash; my $mymeta = CPAN::Meta->new( { %{$meta->as_struct}, prereqs => $prereqs_hash } ); print "Merging cpanfile prereqs to MYMETA.yml\n"; $mymeta->save('MYMETA.yml', { version => 1.4 }); print "Merging cpanfile prereqs to MYMETA.json\n"; $mymeta->save('MYMETA.json', { version => 2 }); Changes1006441073730013260624 204612563056503 20734 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07Revision history for Perl extension JSON::Pointer 0.07 2015-08-13T09:02:56Z - Accept ARRAY in JSON::Pointer::Syntax::as_pointer() - Support Relative JSON Pointer in JSON::Pointer::get_relative() - Fixed issue (https://github.com/zigorou/perl-json-pointer/issues/8) 0.06 2014-09-02T14:09:32Z - Improve JSON primitive type detection (https://github.com/zigorou/perl-json-pointer/pull/7) 0.05 2014-09-01T11:36:15Z - Improve method behavior to RFC6902 (https://github.com/zigorou/perl-json-pointer/pull/6) 0.04 2014-05-21T07:32:53Z - Remove dependency of B version 0.03 Sat Feb 1 23:05:38 JST 2014 - Fixed cpanfile 0.02 Sat Feb 1 19:51:14 JST 2014 - Fixed RT 87314 (https://rt.cpan.org/Public/Bug/Display.html?id=87314) * Patched by aoneko++(https://github.com/aoneko) - Fixed RT 89773 (https://rt.cpan.org/Ticket/Display.html?id=89773) * [Important changes] 0.02 use Clone module instead of Data::Clone. - Support cpanfile by minil 0.01 Mon Feb 18 00:32:55 JST 2013 - original version LICENSE1006441073730013260624 4372412563056503 20476 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07This software is copyright (c) 2014 by zigorou . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2014 by zigorou . This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2014 by zigorou . This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End META.json1006441073730013260624 513412563056503 21063 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07{ "abstract" : "A Perl implementation of JSON Pointer (RFC6901)", "author" : [ "Toru Yamaguchi " ], "dynamic_config" : 0, "generated_by" : "Minilla/v1.0.0", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "JSON-Pointer", "no_index" : { "directory" : [ "t", "xt", "inc", "share", "eg", "examples", "author", "builder" ] }, "prereqs" : { "configure" : { "requires" : { "CPAN::Meta" : "0", "CPAN::Meta::Prereqs" : "0", "Module::Build" : "0.38" } }, "develop" : { "requires" : { "Test::CPAN::Meta" : "0", "Test::MinimumVersion::Fast" : "0.04", "Test::PAUSE::Permissions" : "0.04", "Test::Pod" : "1.41", "Test::Spellunker" : "v0.2.7" } }, "runtime" : { "requires" : { "B" : "0", "Carp" : "1.20", "Class::Accessor::Lite" : "0.05", "Clone" : "0.36", "Exporter" : "0", "JSON" : "2.53", "URI::Escape" : "3.31", "perl" : "5.008001" } }, "test" : { "requires" : { "Test::Exception" : "0.31", "Test::More" : "0.98" } } }, "provides" : { "JSON::Pointer" : { "file" : "lib/JSON/Pointer.pm", "version" : "0.07" }, "JSON::Pointer::Context" : { "file" : "lib/JSON/Pointer/Context.pm", "version" : "0.07" }, "JSON::Pointer::Exception" : { "file" : "lib/JSON/Pointer/Exception.pm", "version" : "0.07" }, "JSON::Pointer::Syntax" : { "file" : "lib/JSON/Pointer/Syntax.pm", "version" : "0.07" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/zigorou/perl-json-pointer/issues" }, "homepage" : "https://github.com/zigorou/perl-json-pointer", "repository" : { "url" : "git://github.com/zigorou/perl-json-pointer.git", "web" : "https://github.com/zigorou/perl-json-pointer" } }, "version" : "0.07", "x_contributors" : [ "aoneko ", "Kensaku Araga ", "Ichito Nagata ", "Hiroyoshi Houchi ", "Toru Yamaguchi " ] } README.md1006441073730013260624 2141212563056503 20736 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07# NAME JSON::Pointer - A Perl implementation of JSON Pointer (RFC6901) # VERSION This document describes JSON::Pointer version 0.07. # SYNOPSIS use JSON::Pointer; my $obj = { foo => 1, bar => [ { qux => "hello" }, 3 ], baz => { boo => [ 1, 3, 5, 7 ] } }; JSON::Pointer->get($obj, "/foo"); ### $obj->{foo} JSON::Pointer->get($obj, "/bar/0"); ### $obj->{bar}[0] JSON::Pointer->get($obj, "/bar/0/qux"); ### $obj->{bar}[0]{qux} JSON::Pointer->get($obj, "/bar/1"); ### $obj->{bar}[1] JSON::Pointer->get($obj, "/baz/boo/2"); ### $obj->{baz}{boo}[2] # DESCRIPTION This library is implemented JSON Pointer ([http://tools.ietf.org/html/rfc6901](http://tools.ietf.org/html/rfc6901)) and some useful operator from JSON Patch ([http://tools.ietf.org/html/rfc6902](http://tools.ietf.org/html/rfc6902)). JSON Pointer is available to identify a specified value in JSON document, and it is simillar to XPath. Please read the both of specifications for details. # METHODS ## get($document :HashRef/ArrayRef/Scalar, $pointer :Str, $strict :Int) :Scalar - $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. - $pointer :Str JSON Pointer string to identify specified value in the document. - $strict :Int Strict mode. When this value equals true value, this method may throw exception on error. When this value equals false value, this method return undef value on error. Get specified value identified by _$pointer_ from _$document_. For example, use JSON::Pointer; print JSON::Pointer->get({ foo => 1, bar => { "qux" => "hello" } }, "/bar/qux"); ### hello ## get\_relative($document :HashRef/ArrayRef/Scalar, $current\_pointer :Str, $relative\_pointer :Str, $strict :Int) :Scalar **This method is highly EXPERIMENTAL**. Because this method depends on [http://tools.ietf.org/html/draft-luff-relative-json-pointer-00](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00) draft spec. - $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. - $current\_pointer : Str JSON Pointer string to identify specified current position in the document. - $relative\_pointer : Str JSON Relative Pointer string to identify specified value from current position in the document - $strict :Int Strict mode. When this value equals true value, this method may throw exception on error. When this value equals false value, this method return undef value on error. ## contains($document :HashRef/ArrayRef/Scalar, $pointer :Str) :Int - $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to present by JSON format. - $pointer :Str JSON Pointer string to identify specified value in the document. Return which the target location identified by _$pointer_ exists or not in the _$document_. use JSON::Pointer; my $document = { foo => 1 }; if (JSON::Pointer->contains($document, "/foo")) { print "/foo exists"; } ## add($document :HashRef/ArrayRef/Scalar, $pointer :Str, $value :HashRef/ArrayRef/Scalar) :HashRef/ArrayRef/Scalar - $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. - $pointer :Str JSON Pointer string to identify specified value in the document. - $value :HashRef/ArrayRef/Scalar The perl data structure that is able to be presented by JSON format. Add specified _$value_ on target location identified by _$pointer_ in the _$document_. For example, use JSON::Pointer; my $document = +{ foo => 1, }; my $value = +{ qux => "hello" }; my $patched_document = JSON::Pointer->add($document, "/bar", $value); print $patched_document->{bar}{qux}; ### hello ## remove($document, $pointer) :Array/Scalar - $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. - $pointer :Str JSON Pointer string to identify specified value in the document. Remove target location identified by _$pointer_ in the _$document_. use JSON::Pointer; my $document = { foo => 1 }; my $patched_document = JSON::Pointer->remove($document, "/foo"); unless (exists $patched_document->{foo}) { print "removed /foo"; } This method is contextial return value. When the return value of _wantarray_ equals true, return _$patched\_document_ and _$removed\_value_, or not return _$patched\_document_ only. ## replace($document :HashRef/ArrayRef/Scalar, $pointer :Str, $value :HashRef/ArrayRef/Scalar) :Array/HashRef/ArrayRef/Scalar - $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. - $pointer :Str JSON Pointer string to identify specified value in the document. - $value :HashRef/ArrayRef/Scalar The perl data structure that is able to be presented by JSON format. Replace the value of target location specified by _$pointer_ to the _$value_ in the _$document_. use JSON::Pointer; my $document = { foo => 1 }; my $patched_document = JSON::Pointer->replace($document, "/foo", 2); print $patched_document->{foo}; ## 2 This method is contextial return value. When the return value of _wantarray_ equals true, return _$patched\_document_ and _$replaced\_value_, or not return _$patched\_document_ only. ## set($document :HashRef/ArrayRef/Scalar, $pointer :Str, $value :HashRef/ArrayRef/Scalar) :Array/HashRef/ArrayRef/Scalar This method is alias of replace method. ## copy($document :HashRef/ArrayRef/Scalar, $from\_pointer :Str, $to\_pointer :Str) :HashRef/ArrayRef/Scalar - $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. - $from\_pointer :Str JSON Pointer string to identify specified value in the document. - $to\_pointer :Str JSON Pointer string to identify specified value in the document. Copy the value identified by _$from\_pointer_ to target location identified by _$to\_pointer_. For example, use JSON::Pointer; my $document = +{ foo => [ { qux => "hello" } ], bar => [ 1 ] }; my $patched_document = JSON::Pointer->copy($document, "/foo/0/qux", "/bar/-"); print $patched_document->{bar}[1]; ## hello Note that "-" notation means next of last element in the array. In this example, "-" means 1. ## move($document :HashRef/ArrayRef/Scalar, $from\_pointer :Str, $to\_pointer :Str) :HashRef/ArrayRef/Scalar - $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. - $from\_pointer :Str JSON Pointer string to identify specified value in the document. - $to\_pointer :Str JSON Pointer string to identify specified value in the document. Move the value identified by _$from\_pointer_ to target location identified by _$to\_pointer_. For example, use JSON; use JSON::Pointer; my $document = +{ foo => [ { qux => "hello" } ], bar => [ 1 ] }; my $patched_document = JSON::Pointer->move($document, "/foo/0/qux", "/bar/-"); print encode_json($patched_document); ## {"bar":[1,"hello"],"foo":[{}]} ## test($document :HashRef/ArrayRef/Scalar, $pointer :Str, $value :HashRef/ArrayRef/Scalar) :Int - $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. - $pointer :Str JSON Pointer string to identify specified value in the document. - $value :HashRef/ArrayRef/Scalar The perl data structure that is able to be presented by JSON format. Return which the value identified by _$pointer_ equals _$value_ or not in the _$document_. This method distinguish type of each values. use JSON::Pointer; my $document = { foo => 1 }; print JSON::Pointer->test($document, "/foo", 1); ### 1 print JSON::Pointer->test($document, "/foo", "1"); ### 0 ## traverse($document, $pointer, $opts) : JSON::Pointer::Context This method is used as internal implementation only. # DEPENDENCIES Perl 5.8.1 or later. # BUGS All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. # SEE ALSO - [perl](https://metacpan.org/pod/perl) - [Mojo::JSON::Pointer](https://metacpan.org/pod/Mojo::JSON::Pointer) Many codes in this module is inspired by the module. - [http://tools.ietf.org/html/rfc6901](http://tools.ietf.org/html/rfc6901) - [http://tools.ietf.org/html/rfc6902](http://tools.ietf.org/html/rfc6902) - [http://tools.ietf.org/html/draft-luff-relative-json-pointer-00](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00) # AUTHOR Toru Yamaguchi # LICENSE AND COPYRIGHT Copyright (c) 2013, Toru Yamaguchi. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. cpanfile1006441073730013260624 50412563056503 21122 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07requires 'perl', '5.008001'; requires 'B'; requires 'Carp' => '1.20'; requires 'Class::Accessor::Lite' => '0.05'; requires 'Clone' => '0.36'; requires 'Exporter'; requires 'JSON' => '2.53'; requires 'URI::Escape' => '3.31'; on 'test' => sub { requires 'Test::More', '0.98'; requires 'Test::Exception', '0.31'; }; Pointer.pm1006441073730013260624 4551212563056503 22763 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/lib/JSONpackage JSON::Pointer; use 5.008_001; use strict; use warnings; use B; use Carp qw(croak); use Clone qw(clone); use JSON qw(encode_json decode_json); use JSON::Pointer::Context; use JSON::Pointer::Exception qw(:all); use JSON::Pointer::Syntax qw(is_array_numeric_index); use URI::Escape qw(uri_unescape); our $VERSION = '0.07'; sub traverse { my ($class, $document, $pointer, $opts) = @_; $opts = +{ strict => 1, inclusive => 0, %{ $opts || +{} } }; $pointer = uri_unescape($pointer); my @tokens = JSON::Pointer::Syntax->tokenize($pointer); my $context = JSON::Pointer::Context->new(+{ pointer => $pointer, tokens => \@tokens, target => $document, parent => $document, }); foreach my $token (@tokens) { $context->begin($token); my $parent = $context->parent; my $type = ref $parent; if ($type eq "HASH") { unless (exists $parent->{$token}) { return _throw_or_return(ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, $context, $opts->{strict}); } $context->next($parent->{$token}); next; } elsif ($type eq "ARRAY") { if ($token eq '-') { $token = $#{$parent} + 1; } my $max_index = $#{$parent}; $max_index++ if $opts->{inclusive}; if (is_array_numeric_index($token) && $token <= $max_index) { $context->next($parent->[$token]); next; } else { return _throw_or_return(ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, $context, $opts->{strict}); } } else { return _throw_or_return(ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, $context, $opts->{strict}); } } $context->result(1); return $context; } sub get { my ($class, $document, $pointer, $strict) = @_; $strict = 0 unless defined $strict; my $context; eval { $context = $class->traverse($document, $pointer, +{ strict => $strict }); }; if (my $e = $@) { croak $e; } return $context->result ? $context->target : undef; } sub get_relative { my ($class, $document, $current_pointer, $relative_pointer, $strict) = @_; $strict = 0 unless defined $strict; my @current_tokens = JSON::Pointer::Syntax->tokenize($current_pointer); my $context = JSON::Pointer::Context->new(+{ pointer => $current_pointer, tokens => \@current_tokens, target => $document, parent => $document, }); my ($steps, $relative_pointer_suffix, $use_index) = ($relative_pointer =~ m{^(0|[1-9]?[0-9]+)([^#]*)(#?)$}); $relative_pointer_suffix ||= ""; unless (defined $steps) { return _throw_or_return(ERROR_INVALID_POINTER_SYNTAX, $context, +{ strict => $strict }); } for (my $i = 0; $i < $steps; $i++) { if (@current_tokens == 0) { return _throw_or_return(ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, $context, +{ strict => $strict }); } pop(@current_tokens); } if ($use_index) { my @relative_tokens = JSON::Pointer::Syntax->tokenize($relative_pointer_suffix); return (@relative_tokens > 0) ? $relative_tokens[-1] : $current_tokens[-1]; } my $absolute_pointer = JSON::Pointer::Syntax->as_pointer(@current_tokens) . $relative_pointer_suffix; eval { $context = $class->traverse($document, $absolute_pointer, +{ strict => $strict }); }; if (my $e = $@) { croak $e; } return $context->result ? $context->target : undef; } sub contains { my ($class, $document, $pointer) = @_; my $context = $class->traverse($document, $pointer, +{ strict => 0 }); return $context->result; } sub add { my ($class, $document, $pointer, $value) = @_; my $patched_document = clone($document); my $context = $class->traverse($patched_document, $pointer, +{ strict => 0, inclusive => 1 }); my $parent = $context->parent; my $type = ref $parent; if ($type eq "HASH") { if (!$context->result && @{$context->processed_tokens} < @{$context->tokens} - 1) { ### Parent isn't object JSON::Pointer::Exception->throw( code => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, context => $context, ); } if (defined $context->last_token) { $parent->{$context->last_token} = $value; } else { ### pointer is empty string (whole document) $patched_document = $value; } return $patched_document; } elsif ($type eq "ARRAY") { unless ($context->result) { JSON::Pointer::Exception->throw( code => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, context => $context, ); } if (defined $context->last_token) { my $parent_array_length = $#{$parent} + 1; my $target_index = ($context->last_token eq "-") ? $parent_array_length : $context->last_token; splice(@$parent, $target_index, 0, $value); } else { $patched_document = $value; } return $patched_document; } else { unless ($context->result) { JSON::Pointer::Exception->throw( code => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, context => $context, ); } return $value; } } sub remove { my ($class, $document, $pointer) = @_; my $patched_document = clone($document); my $context = $class->traverse($patched_document, $pointer); my $parent = $context->parent; my $type = ref $parent; if ($type eq "HASH") { my $target_member = $context->last_token; if (defined $target_member) { my $removed = delete $parent->{$target_member}; return wantarray ? ($patched_document, $removed) : $patched_document; } else { ### pointer is empty string (whole document) return wantarray ? (undef, $patched_document) : undef; } } elsif ($type eq "ARRAY") { my $target_index = $context->last_token; if (defined $target_index) { my $parent_array_length = $#{$parent} + 1; $target_index = $parent_array_length if ($target_index eq "-"); my $removed = splice(@$parent, $target_index, 1); return wantarray ? ($patched_document, $removed) : $patched_document; } else { ### pointer is empty string (whole document) return wantarray ? (undef, $patched_document) : undef; } } else { unless ($context->result) { JSON::Pointer::Exception->throw( code => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, context => $context, ); } return wantarray ? (undef, $patched_document) : undef; } } sub replace { my ($class, $document, $pointer, $value) = @_; my $patched_document = clone($document); my $context = $class->traverse($patched_document, $pointer); my $parent = $context->parent; my $type = ref $parent; if ($type eq "HASH") { my $target_member = $context->last_token; if (defined $target_member) { my $replaced = $parent->{$context->last_token}; $parent->{$context->last_token} = $value; return wantarray ? ($patched_document, $replaced) : $patched_document; } else { ### pointer is empty string (whole document) return wantarray ? ($value, $patched_document) : $value; } } else { my $target_index = $context->last_token; if (defined $target_index) { my $parent_array_length = $#{$parent} + 1; $target_index = $parent_array_length if ($target_index eq "-"); my $replaced = $parent->[$target_index]; $parent->[$target_index] = $value; return wantarray ? ($patched_document, $replaced) : $patched_document; } else { ### pointer is empty string (whole document) return wantarray ? ($value, $patched_document) : $value; } } } sub set { shift->replace(@_); } sub copy { my ($class, $document, $from_pointer, $to_pointer) = @_; my $context = $class->traverse($document, $from_pointer); return $class->add($document, $to_pointer, $context->target); } sub move { my ($class, $document, $from_pointer, $to_pointer) = @_; my ($patched_document, $removed) = $class->remove($document, $from_pointer); $class->add($patched_document, $to_pointer, $removed); } sub test { my ($class, $document, $pointer, $value) = @_; my $context = $class->traverse($document, $pointer, +{ strict => 0 }); return 0 unless $context->result; my $target = $context->target; my $target_type = ref $target; if ($target_type eq "HASH" || $target_type eq "ARRAY") { return encode_json($target) eq encode_json($value) ? 1 : 0; } elsif (defined $target) { if (JSON::is_bool($target)) { return JSON::is_bool($value) && $target == $value ? 1 : 0; } elsif (_is_iv_or_nv($target) && _is_iv_or_nv($value)) { return $target == $value ? 1 : 0; } elsif (_is_pv($target) && _is_pv($value)) { return $target eq $value ? 1 : 0; } else { return 0; } } else { ### null return !defined $value ? 1 : 0; } } sub _throw_or_return { my ($code, $context, $strict) = @_; if ($strict) { JSON::Pointer::Exception->throw( code => $code, context => $context, ); } else { $context->last_error($code); return $context; } } sub _is_iv_or_nv { my $value = shift; my $flags = B::svref_2object(\$value)->FLAGS; return ( ($flags & ( B::SVp_IOK | B::SVp_NOK )) && !($flags & B::SVp_POK) ); } sub _is_pv { my $value = shift; my $flags = B::svref_2object(\$value)->FLAGS; return ( !($flags & ( B::SVp_IOK | B::SVp_NOK )) && ($flags & B::SVp_POK) ); } 1; __END__ =head1 NAME JSON::Pointer - A Perl implementation of JSON Pointer (RFC6901) =head1 VERSION This document describes JSON::Pointer version 0.07. =head1 SYNOPSIS use JSON::Pointer; my $obj = { foo => 1, bar => [ { qux => "hello" }, 3 ], baz => { boo => [ 1, 3, 5, 7 ] } }; JSON::Pointer->get($obj, "/foo"); ### $obj->{foo} JSON::Pointer->get($obj, "/bar/0"); ### $obj->{bar}[0] JSON::Pointer->get($obj, "/bar/0/qux"); ### $obj->{bar}[0]{qux} JSON::Pointer->get($obj, "/bar/1"); ### $obj->{bar}[1] JSON::Pointer->get($obj, "/baz/boo/2"); ### $obj->{baz}{boo}[2] =head1 DESCRIPTION This library is implemented JSON Pointer (L) and some useful operator from JSON Patch (L). JSON Pointer is available to identify a specified value in JSON document, and it is simillar to XPath. Please read the both of specifications for details. =head1 METHODS =head2 get($document :HashRef/ArrayRef/Scalar, $pointer :Str, $strict :Int) :Scalar =over =item $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. =item $pointer :Str JSON Pointer string to identify specified value in the document. =item $strict :Int Strict mode. When this value equals true value, this method may throw exception on error. When this value equals false value, this method return undef value on error. =back Get specified value identified by I<$pointer> from I<$document>. For example, use JSON::Pointer; print JSON::Pointer->get({ foo => 1, bar => { "qux" => "hello" } }, "/bar/qux"); ### hello =head2 get_relative($document :HashRef/ArrayRef/Scalar, $current_pointer :Str, $relative_pointer :Str, $strict :Int) :Scalar B. Because this method depends on L draft spec. =over =item $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. =item $current_pointer : Str JSON Pointer string to identify specified current position in the document. =item $relative_pointer : Str JSON Relative Pointer string to identify specified value from current position in the document =item $strict :Int Strict mode. When this value equals true value, this method may throw exception on error. When this value equals false value, this method return undef value on error. =back =head2 contains($document :HashRef/ArrayRef/Scalar, $pointer :Str) :Int =over =item $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to present by JSON format. =item $pointer :Str JSON Pointer string to identify specified value in the document. =back Return which the target location identified by I<$pointer> exists or not in the I<$document>. use JSON::Pointer; my $document = { foo => 1 }; if (JSON::Pointer->contains($document, "/foo")) { print "/foo exists"; } =head2 add($document :HashRef/ArrayRef/Scalar, $pointer :Str, $value :HashRef/ArrayRef/Scalar) :HashRef/ArrayRef/Scalar =over =item $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. =item $pointer :Str JSON Pointer string to identify specified value in the document. =item $value :HashRef/ArrayRef/Scalar The perl data structure that is able to be presented by JSON format. =back Add specified I<$value> on target location identified by I<$pointer> in the I<$document>. For example, use JSON::Pointer; my $document = +{ foo => 1, }; my $value = +{ qux => "hello" }; my $patched_document = JSON::Pointer->add($document, "/bar", $value); print $patched_document->{bar}{qux}; ### hello =head2 remove($document, $pointer) :Array/Scalar =over =item $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. =item $pointer :Str JSON Pointer string to identify specified value in the document. =back Remove target location identified by I<$pointer> in the I<$document>. use JSON::Pointer; my $document = { foo => 1 }; my $patched_document = JSON::Pointer->remove($document, "/foo"); unless (exists $patched_document->{foo}) { print "removed /foo"; } This method is contextial return value. When the return value of I equals true, return I<$patched_document> and I<$removed_value>, or not return I<$patched_document> only. =head2 replace($document :HashRef/ArrayRef/Scalar, $pointer :Str, $value :HashRef/ArrayRef/Scalar) :Array/HashRef/ArrayRef/Scalar =over =item $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. =item $pointer :Str JSON Pointer string to identify specified value in the document. =item $value :HashRef/ArrayRef/Scalar The perl data structure that is able to be presented by JSON format. =back Replace the value of target location specified by I<$pointer> to the I<$value> in the I<$document>. use JSON::Pointer; my $document = { foo => 1 }; my $patched_document = JSON::Pointer->replace($document, "/foo", 2); print $patched_document->{foo}; ## 2 This method is contextial return value. When the return value of I equals true, return I<$patched_document> and I<$replaced_value>, or not return I<$patched_document> only. =head2 set($document :HashRef/ArrayRef/Scalar, $pointer :Str, $value :HashRef/ArrayRef/Scalar) :Array/HashRef/ArrayRef/Scalar This method is alias of replace method. =head2 copy($document :HashRef/ArrayRef/Scalar, $from_pointer :Str, $to_pointer :Str) :HashRef/ArrayRef/Scalar =over =item $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. =item $from_pointer :Str JSON Pointer string to identify specified value in the document. =item $to_pointer :Str JSON Pointer string to identify specified value in the document. =back Copy the value identified by I<$from_pointer> to target location identified by I<$to_pointer>. For example, use JSON::Pointer; my $document = +{ foo => [ { qux => "hello" } ], bar => [ 1 ] }; my $patched_document = JSON::Pointer->copy($document, "/foo/0/qux", "/bar/-"); print $patched_document->{bar}[1]; ## hello Note that "-" notation means next of last element in the array. In this example, "-" means 1. =head2 move($document :HashRef/ArrayRef/Scalar, $from_pointer :Str, $to_pointer :Str) :HashRef/ArrayRef/Scalar =over =item $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. =item $from_pointer :Str JSON Pointer string to identify specified value in the document. =item $to_pointer :Str JSON Pointer string to identify specified value in the document. =back Move the value identified by I<$from_pointer> to target location identified by I<$to_pointer>. For example, use JSON; use JSON::Pointer; my $document = +{ foo => [ { qux => "hello" } ], bar => [ 1 ] }; my $patched_document = JSON::Pointer->move($document, "/foo/0/qux", "/bar/-"); print encode_json($patched_document); ## {"bar":[1,"hello"],"foo":[{}]} =head2 test($document :HashRef/ArrayRef/Scalar, $pointer :Str, $value :HashRef/ArrayRef/Scalar) :Int =over =item $document :HashRef/ArrayRef/Scalar Target perl data structure that is able to be presented by JSON format. =item $pointer :Str JSON Pointer string to identify specified value in the document. =item $value :HashRef/ArrayRef/Scalar The perl data structure that is able to be presented by JSON format. =back Return which the value identified by I<$pointer> equals I<$value> or not in the I<$document>. This method distinguish type of each values. use JSON::Pointer; my $document = { foo => 1 }; print JSON::Pointer->test($document, "/foo", 1); ### 1 print JSON::Pointer->test($document, "/foo", "1"); ### 0 =head2 traverse($document, $pointer, $opts) : JSON::Pointer::Context This method is used as internal implementation only. =head1 DEPENDENCIES Perl 5.8.1 or later. =head1 BUGS All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. =head1 SEE ALSO =over =item L =item L Many codes in this module is inspired by the module. =item L =item L =item L =back =head1 AUTHOR Toru Yamaguchi Ezigorou at cpan.orgE =head1 LICENSE AND COPYRIGHT Copyright (c) 2013, Toru Yamaguchi. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Context.pm1006441073730013260624 363212563056503 24364 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/lib/JSON/Pointerpackage JSON::Pointer::Context; use 5.008_001; use strict; use warnings; use Class::Accessor::Lite ( new => 0, rw => [ qw/ pointer tokens processed_tokens last_token last_error result target parent / ], ); our $VERSION = "0.07"; sub new { my $class = shift; my $args = ref $_[0] ? $_[0] : +{ @_ }; %$args = ( tokens => [], processed_tokens => [], last_token => undef, last_error => undef, result => 0, target => undef, parent => undef, %$args, ); bless $args => $class; } sub begin { my ($self, $token) = @_; $self->{last_token} = $token; ### assign before target into parent $self->{parent} = $self->{target}; } sub next { my ($self, $target) = @_; $self->{target} = $target; push(@{$self->{processed_tokens}}, $self->{last_token}); } 1; __END__ =head1 NAME JSON::Pointer::Context - Internal context object to process JSON Pointer =head1 VERSION This document describes JSON::Pointer::Context version 0.07. =head1 SYNOPSIS =head1 DESCRIPTION This module is internal only. =head1 METHODS =head2 new(%args) :JSON::Pointer::Context =head2 begin($token) =head2 next($target) =head1 DEPENDENCIES Perl 5.8.1 or later. =head1 BUGS All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. =head1 SEE ALSO =over =item L =item L =back =head1 AUTHOR Toru Yamaguchi Ezigorou at cpan.orgE =head1 LICENSE AND COPYRIGHT Copyright (c) 2013, Toru Yamaguchi. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Exception.pm1006441073730013260624 406012563056503 24672 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/lib/JSON/Pointerpackage JSON::Pointer::Exception; use 5.008_001; use strict; use warnings; use overload ( q|""| => "to_string" ); use Carp (); use Exporter qw(import); our $VERSION = '0.07'; our @EXPORT_OK = qw( ERROR_INVALID_POINTER_SYNTAX ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE ); our %EXPORT_TAGS = ( all => [ @EXPORT_OK ], ); sub ERROR_INVALID_POINTER_SYNTAX { 1; } sub ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE { 2; } our %MESSAGE_BUNDLES = ( ERROR_INVALID_POINTER_SYNTAX() => "Invalid pointer syntax (pointer: %s)", ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE() => "A pointer that references a non-existent value (pointer: %s)", ); sub new { my ($class, %opts) = @_; $opts{context}->last_error($opts{code}); bless { code => $opts{code}, context => $opts{context}, } => $class } sub throw { Carp::croak(shift->new(@_)); } sub code { shift->{code}; } sub context { shift->{context}; } sub to_string { my $self = shift; sprintf($MESSAGE_BUNDLES{$self->{code}}, $self->{context}{pointer}); } 1; __END__ =head1 NAME JSON::Pointer::Exception - Exception class for JSON::Pointer =head1 VERSION This document describes JSON::Pointer::Exception version 0.07 =head1 SYNOPSIS =head1 DESCRIPTION =head1 METHODS =head2 new(%opts) : JSON::Pointer::Exception =head2 throw(%opts) =head2 code :Int =head2 context :JSON::Pointer::Context =head2 to_string :Str =head1 CONSTANTS =head2 ERROR_INVALID_POINTER_SYNTAX =head2 ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE =head1 DEPENDENCIES Perl 5.8.1 or later. =head1 BUGS All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. =head1 SEE ALSO =over =item L =back =head1 AUTHOR Toru Yamaguchi Ezigorou at cpan.orgE =head1 LICENSE AND COPYRIGHT Copyright (c) 2013, Toru Yamaguchi. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Syntax.pm1006441073730013260624 553012563056503 24225 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/lib/JSON/Pointerpackage JSON::Pointer::Syntax; use 5.008_001; use strict; use warnings; use Exporter qw(import); use JSON::Pointer::Context; use JSON::Pointer::Exception qw(:all); our $VERSION = '0.07'; our @EXPORT_OK = qw( escape_reference_token unescape_reference_token is_array_numeric_index ); our $REGEX_ESCAPED = qr{~[01]}; our $REGEX_UNESCAPED = qr{[\x{00}-\x{2E}\x{30}-\x{7D}\x{7F}-\x{10FFFF}]}; our $REGEX_REFERENCE_TOKEN = qr{(?:$REGEX_ESCAPED|$REGEX_UNESCAPED)*}; our $REGEX_ARRAY_INDEX = qr{(?:0|[1-9][0-9]*)}; sub escape_reference_token { my $unescaped_reference_token = shift; $unescaped_reference_token =~ s/~/~0/g; $unescaped_reference_token =~ s/\x2F/~1/g; return $unescaped_reference_token; } sub unescape_reference_token { my $escaped_reference_token = shift; $escaped_reference_token =~ s/~1/\x2F/g; $escaped_reference_token =~ s/~0/~/g; return $escaped_reference_token; } sub tokenize { my ($class, $pointer) = @_; my @tokens; my $orig_pointer = $pointer; while ($pointer =~ s{/($REGEX_REFERENCE_TOKEN)}{}) { my $token = $1; push @tokens => unescape_reference_token($token); } unless ($orig_pointer eq "" || $pointer eq "") { JSON::Pointer::Exception->throw( code => ERROR_INVALID_POINTER_SYNTAX, context => JSON::Pointer::Context->new( pointer => $orig_pointer, ), ); } return wantarray ? @tokens : [ @tokens ]; } sub as_pointer { my $class = shift; my @tokens = (ref $_[0] eq "ARRAY") ? @{$_[0]} : @_; return @tokens > 0 ? "/" . join( "/", map { escape_reference_token($_) } @tokens ) : ""; } sub is_array_numeric_index { my $token = shift; return $token =~ m/^$REGEX_ARRAY_INDEX$/ ? 1 : 0; } 1; __END__ =head1 NAME JSON::Pointer::Syntax - JSON Pointer syntax functions =head1 VERSION This document describes JSON::Pointer::Syntax version 0.07. =head1 SYNOPSIS =head1 DESCRIPTION This module is internal only. =head1 FUNCTIONS =head2 escape_reference_token($unescaped_reference_token :Str) :Str =head2 unescape_reference_token($escaped_reference_token :Str) :Str =head2 tokenize($pointer :Str) : Array/ArrayRef =head2 as_pointer(\@tokens) :Str =head2 is_array_numeric_index($token) :Int =head1 DEPENDENCIES Perl 5.8.1 or later. =head1 BUGS All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. =head1 SEE ALSO =over =item L =item L =back =head1 AUTHOR Toru Yamaguchi Ezigorou at cpan.orgE =head1 LICENSE AND COPYRIGHT Copyright (c) 2013, Toru Yamaguchi. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut minil.toml1006441073730013260624 2512563056503 21401 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07name = "JSON-Pointer"000_load.t1006441073730013260624 31112563056503 21340 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/t#!perl -w use strict; use Test::More tests => 4; BEGIN { use_ok 'JSON::Pointer'; use_ok 'JSON::Pointer::Context'; use_ok 'JSON::Pointer::Exception'; use_ok 'JSON::Pointer::Syntax'; } 001_traverse.t1006441073730013260624 1162012563056503 22322 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/tuse strict; use warnings; use Test::More; use JSON; use JSON::Pointer; use JSON::Pointer::Exception qw(:all); my $document = decode_json(<< 'JSON'); { "foo": ["bar", "baz"], "": 0, "a/b": 1, "c%d": 2, "e^f": 3, "g|h": 4, "i\\j": 5, "k\"l": 6, " ": 7, "m~n": 8 } JSON sub test_traverse { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { my $context = JSON::Pointer->traverse($document, $input, +{ strict => 0 }); is($context->result, $expect->{result}, "result"); is($context->last_token, $expect->{last_token}, "last_token"); is($context->last_error, $expect->{last_error}, "last_error"); is_deeply($context->parent, $expect->{parent}, "parent"); is_deeply($context->target, $expect->{target}, "target"); }; } subtest "JSON Pointer Section 5 examples" => sub { test_traverse "the whole document" => ( input => "", expect => +{ result => 1, parent => $document, target => $document, last_token => undef, last_error => undef, } ); test_traverse "/foo" => ( input => "/foo", expect => +{ result => 1, parent => $document, target => $document->{foo}, last_token => "foo", last_error => undef, } ); test_traverse "/foo/0" => ( input => "/foo/0", expect => +{ result => 1, parent => $document->{foo}, target => $document->{foo}[0], last_token => "0", last_error => undef, } ); test_traverse "/" => ( input => "/", expect => +{ result => 1, parent => $document, target => $document->{""}, last_token => "", last_error => undef, } ); test_traverse "/a~1b" => ( input => "/a~1b", expect => +{ result => 1, parent => $document, target => $document->{"a/b"}, last_token => "a/b", last_error => undef, } ); test_traverse "/a~1b" => ( input => "/a~1b", expect => +{ result => 1, parent => $document, target => $document->{"a/b"}, last_token => "a/b", last_error => undef, } ); test_traverse "/c\%d" => ( input => "/c\%d", expect => +{ result => 1, parent => $document, target => $document->{"c\%d"}, last_token => "c\%d", last_error => undef, } ); test_traverse "/e^f" => ( input => "/e^f", expect => +{ result => 1, parent => $document, target => $document->{"e^f"}, last_token => "e^f", last_error => undef, } ); test_traverse "/g|h" => ( input => "/g|h", expect => +{ result => 1, parent => $document, target => $document->{"g|h"}, last_token => "g|h", last_error => undef, } ); test_traverse "/i\\j" => ( input => "/i\\j", expect => +{ result => 1, parent => $document, target => $document->{"i\\j"}, last_token => "i\\j", last_error => undef, } ); test_traverse "/ " => ( input => "/ ", expect => +{ result => 1, parent => $document, target => $document->{" "}, last_token => " ", last_error => undef, } ); test_traverse "/m~0n" => ( input => "/m~0n", expect => +{ result => 1, parent => $document, target => $document->{"m~n"}, last_token => "m~n", last_error => undef, } ); }; subtest "Exceptions" => sub { test_traverse "" => ( input => "/foo/bar", expect => +{ result => 0, parent => $document->{foo}, target => $document->{foo}, last_token => "bar", last_error => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, } ); test_traverse "/foo/bar" => ( input => "/foo/bar", expect => +{ result => 0, parent => $document->{foo}, target => $document->{foo}, last_token => "bar", last_error => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, } ); test_traverse "/bar/3/baz" => ( input => "/bar/3/baz", expect => +{ result => 0, parent => $document, target => $document, last_token => "bar", last_error => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, } ); }; done_testing; 002_get.t1006441073730013260624 572312563056503 21236 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/tuse strict; use warnings; use Test::More; use Test::Exception; use Carp; use JSON; use JSON::Pointer; use JSON::Pointer::Exception qw(:all); my $document = decode_json(<< 'JSON'); { "foo": ["bar", "baz"], "": 0, "a/b": 1, "c%d": 2, "e^f": 3, "g|h": 4, "i\\j": 5, "k\"l": 6, " ": 7, "m~n": 8 } JSON sub test_get { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { my $actual = JSON::Pointer->get($document, $input); is_deeply($actual, $expect, "target"); }; } sub test_get_exception { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { throws_ok { eval { JSON::Pointer->get($document, $input, +{ strict => 1 }); }; if (my $e = $@) { is($e->context->last_token, $expect->{last_token}, "last_token"); is($e->context->last_error, $expect->{last_error}, "last_error"); croak $e; } } "JSON::Pointer::Exception" => "throws_ok"; }; } subtest "JSON Pointer Section 5 examples" => sub { test_get "the whole document" => ( input => "", expect => $document, ); test_get "/foo" => ( input => "/foo", expect => $document->{foo}, ); test_get "/foo/0" => ( input => "/foo/0", expect => $document->{foo}[0], ); test_get "/" => ( input => "/", expect => $document->{""}, ); test_get "/a~1b" => ( input => "/a~1b", expect => $document->{"a/b"}, ); test_get "/a~1b" => ( input => "/a~1b", expect => $document->{"a/b"}, ); test_get "/c\%d" => ( input => "/c\%d", expect => $document->{"c\%d"}, ); test_get "/e^f" => ( input => "/e^f", expect => $document->{"e^f"}, ); test_get "/g|h" => ( input => "/g|h", expect => $document->{"g|h"}, ); test_get "/i\\j" => ( input => "/i\\j", expect => $document->{"i\\j"}, ); test_get "/ " => ( input => "/ ", expect => $document->{" "}, ); test_get "/m~0n" => ( input => "/m~0n", expect => $document->{"m~n"}, ); }; subtest "Exceptions" => sub { test_get_exception "" => ( input => "/foo/bar", expect => +{ last_token => "bar", last_error => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, } ); test_get_exception "/foo/bar" => ( input => "/foo/bar", expect => +{ last_token => "bar", last_error => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, } ); test_get_exception "/bar/3/baz" => ( input => "/bar/3/baz", expect => +{ last_token => "bar", last_error => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, } ); }; done_testing; 003_mojo_json_pointer_compat.t1006441073730013260624 511312563056503 25551 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/tuse strict; use warnings; use Test::More; use JSON::Pointer; # "contains" (hash) my $pointer = "JSON::Pointer"; ok $pointer->contains({foo => 23}, ''), 'contains ""'; ok $pointer->contains({foo => 23}, '/foo'), 'contains "/foo"'; ok !$pointer->contains({foo => 23}, '/bar'), 'does not contains "/bar"'; ok $pointer->contains({foo => {bar => undef}}, '/foo/bar'), 'contains "/foo/bar"'; # "contains" (mixed) ok $pointer->contains({foo => [0, 1, 2]}, ''), 'contains ""'; ok $pointer->contains({foo => [0, 1, 2]}, '/foo/0'), 'contains "/foo/0"'; ok !$pointer->contains({foo => [0, 1, 2]}, '/foo/9'), 'does not contain "/foo/9"'; ok !$pointer->contains({foo => [0, 1, 2]}, '/foo/bar'), 'does not contain "/foo/bar"'; ok !$pointer->contains({foo => [0, 1, 2]}, '/0'), 'does not contain "/0"'; # "get" (hash) is_deeply $pointer->get({foo => 'bar'}, ''), {foo => 'bar'}, '"" is "{foo => "bar"}"'; is $pointer->get({foo => 'bar'}, '/foo'), 'bar', '"/foo" is "bar"'; is $pointer->get({foo => {bar => 42}}, '/foo/bar'), 42, '"/foo/bar" is "42"'; is_deeply $pointer->get({foo => {23 => {baz => 0}}}, '/foo/23'), {baz => 0}, '"/foo/23" is "{baz => 0}"'; # "get" (mixed) is_deeply $pointer->get({foo => {bar => [1, 2, 3]}}, '/foo/bar'), [1, 2, 3], '"/foo/bar" is "[1, 2, 3]"'; is $pointer->get({foo => {bar => [0, undef, 3]}}, '/foo/bar/0'), 0, '"/foo/bar/0" is "0"'; is $pointer->get({foo => {bar => [0, undef, 3]}}, '/foo/bar/1'), undef, '"/foo/bar/1" is "undef"'; is $pointer->get({foo => {bar => [0, undef, 3]}}, '/foo/bar/2'), 3, '"/foo/bar/2" is "3"'; is $pointer->get({foo => {bar => [0, undef, 3]}}, '/foo/bar/6'), undef, '"/foo/bar/6" is "undef"'; # "get" (encoded) is $pointer->get({'♥' => [0, 1]}, '/%E2%99%A5/0'), 0, '"/%E2%99%A5/0" is "0"'; is $pointer->get([{'^foob ar' => 'foo'}], '/0/^foob ar'), 'foo', '"/0/^foob ar" is "foo"'; is $pointer->get([{'foob ar' => 'foo'}], '/0/foob%20ar'), 'foo', '"/0/foob%20ar" is "foo"'; is $pointer->get([{'foo/bar' => 'bar'}], '/0/foo%2Fbar'), undef, '"/0/foo%2Fbar" is "undef"'; is $pointer->get([{'foo/bar' => 'bar'}], '/0/foo~1bar'), 'bar', '"/0/foo~1bar" is "bar"'; is $pointer->get([{'foo/bar/baz' => 'yada'}], '/0/foo~1bar~1baz'), 'yada', '"/0/foo~1bar~1baz" is "yada"'; is $pointer->get([{'foo~/bar' => 'bar'}], '/0/foo~0~1bar'), 'bar', '"/0/foo~0~1bar" is "bar"'; is $pointer->get([{'foo~/bar' => 'bar'}], '/0/foo%7E%30%7E%31bar'), 'bar', '"/0/foo%7E%30%7E%31bar" is "bar"'; is $pointer->get( [{'f~o~o~/b~' => {'a~' => {'r' => 'baz'}}}] => '/0/f~0o~0o~0~1b~0/a~0/r'), 'baz', '"/0/f~0o~0o~0~1b~0/a~0/r" is "baz"'; done_testing(); 004_add.t1006441073730013260624 2353112563056503 21226 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/tuse strict; use warnings; use Test::More; use Test::Exception; use Carp; use JSON; use JSON::Pointer; use JSON::Pointer::Exception qw(:all); sub test_add { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { my ($document, $pointer, $value) = @$input{qw/document pointer value/}; my $patched_document = JSON::Pointer->add($document, $pointer, $value); is_deeply( $patched_document, $expect->{patched}, sprintf( "added document (actual: %s. expected: %s)", encode_json($patched_document), encode_json($expect->{patched}) ) ); }; } sub test_add_exception { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { my ($document, $pointer, $value) = @$input{qw/document pointer value/}; throws_ok { eval { my $patched_document = JSON::Pointer->add($document, $pointer, $value); }; if (my $e = $@) { is($e->code, ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, "code"); croak $e; } } "JSON::Pointer::Exception" => "throws_ok"; }; } # https://github.com/json-patch/json-patch-tests subtest "JSON Patch Section 4.1" => sub { test_add "add with existing object field" => ( input => +{ document => +{ a => +{ foo => 1 } }, pointer => "/a/b", value => "qux" }, expect => +{ patched => +{ a => +{ foo => 1, b => "qux" } } } ); test_add_exception "add with missing object" => ( input => +{ document => +{ q => +{ bar => 2 } }, pointer => "/a/b", value => "qux", }, expect => +{ code => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE }, ); }; subtest "JSON Patch Appendix A. Example" => sub { test_add "A1. Adding an Object Member" => ( input => +{ document => { foo => "bar" }, pointer => "/baz", value => "qux" }, expect => +{ patched => +{ foo => "bar", baz => "qux", } } ); test_add "A2. Adding an Array Element" => ( input => +{ document => { foo => ["bar", "baz"] }, pointer => "/foo/1", value => "qux" }, expect => +{ patched => +{ foo => ["bar", "qux", "baz"] } } ); test_add "A.10. Adding a nested Member Object" => ( input => +{ document => +{ foo => "bar" }, pointer => "/child", value => +{ grandchild => +{} }, }, expect => +{ patched => +{ foo => "bar", child => +{ grandchild => +{} }, } } ); test_add_exception "A.11. Ignoring Unrecognized Elements" => ( input => +{ document => +{ foo => "bar" }, pointer => "/baz/bat", value => "qux", }, expect => +{ code => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, } ); test_add "A.16. Adding an Array Value" => ( input => +{ document => +{ foo => ["bar"] }, pointer => "/foo/-", value => ["abc", "def"], }, expect => +{ patched => +{ foo => [ "bar", ["abc", "def", ], ], } } ); }; subtest "https://github.com/json-patch/json-patch-tests/blob/master/tests.json" => sub { test_add "add replaces any existing field" => ( input => +{ document => { foo => undef }, pointer => "/foo", value => 1 }, expect => +{ patched => +{ foo => 1 } } ); test_add "toplevel array" => ( input => +{ document => [], pointer => "/0", value => "foo", }, expect => +{ rv => 1, patched => ["foo"] } ); test_add "toplevel object, numeric string" => ( input => +{ document => +{}, pointer => "/foo", value => "1", }, expect => +{ patched => +{ foo => "1" }, } ); test_add "toplevel object, numeric string" => ( input => +{ document => +{}, pointer => "/foo", value => 1, }, expect => +{ patched => +{ foo => 1 }, } ); test_add "Add, / target" => ( input => +{ document => +{}, pointer => "/", value => 1, }, expect => +{ patched => +{ "" => 1, }, } ); test_add "Add composite value at top level" => ( input => +{ document => +{ foo => 1, }, pointer => "/bar", value => [1, 2], }, expect => +{ patched => +{ foo => 1, bar => [1, 2], }, } ); test_add "Add into composite value" => ( input => +{ document => +{ foo => 1, baz => [ +{ qux => "hello", } ], }, pointer => "/baz/0/foo", value => "world", }, expect => +{ patched => +{ foo => 1, baz => [ +{ foo => "world", qux => "hello", }, ], }, } ); test_add_exception "Out of bounds (upper)" => ( input => +{ document => +{ bar => [1, 2,], }, pointer => "/bar/8", value => "5", }, expect => +{ code => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, }, ); test_add_exception "Out of bounds (lower)" => ( input => +{ document => +{ bar => [1, 2,], }, pointer => "/bar/-1", value => "5", }, expect => +{ code => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, }, ); test_add "Add boolean value (true) at toplevel object" => ( input => +{ document => +{ foo => 1, }, pointer => "/bar", value => JSON::true, }, expect => +{ patched => +{ foo => 1, bar => JSON::true, }, } ); test_add "Add boolean value (false) at toplevel object" => ( input => +{ document => +{ foo => 1, }, pointer => "/bar", value => JSON::false, }, expect => +{ patched => +{ foo => 1, bar => JSON::false, }, } ); test_add "Add null value at toplevel object" => ( input => +{ document => +{ foo => 1, }, pointer => "/bar", value => undef, }, expect => +{ patched => +{ foo => 1, bar => undef, }, } ); test_add "0 can be an array index or object element name" => ( input => +{ document => +{ foo => 1, }, pointer => "/0", value => "bar", }, expect => +{ patched => +{ foo => 1, 0 => "bar", }, } ); test_add "Add string value into toplevel array" => ( input => +{ document => [ "foo", ], pointer => "/1", value => "bar", }, expect => +{ patched => [ "foo", "bar", ], } ); test_add "Add string value into existing element of toplevel array" => ( input => +{ document => [ "foo", "sil", ], pointer => "/1", value => "bar", }, expect => +{ patched => [ "foo", "bar", "sil", ], } ); test_add "Add string value into first element of toplevel array" => ( input => +{ document => [ "foo", "sil", ], pointer => "/0", value => "bar", }, expect => +{ patched => [ "bar", "foo", "sil", ], } ); test_add "Add string value into next last element of toplevel array" => ( input => +{ document => [ "foo", "sil", ], pointer => "/2", value => "bar", }, expect => +{ patched => [ "foo", "sil", "bar", ], } ); test_add_exception "Object operation on array target" => ( input => +{ document => ["foo", "sil", ], pointer => "/bar", value => 42, }, expect => +{ code => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, }, ); test_add "value in array add not flattened" => ( input => +{ document => ["foo", "sil", ], pointer => "/1", value => ["bar", "baz", ], }, expect => +{ patched => [ "foo", ["bar", "baz", ], "sil", ], }, ); test_add "replacing the root of the document is possible with add" => ( input => +{ document => +{ foo => "bar", }, pointer => "", value => +{ baz => "qux", }, }, expect => +{ patched => +{ baz => "qux", }, }, ); }; done_testing; 005_remove.t1006441073730013260624 1067612563056503 22002 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/tuse strict; use warnings; use Test::More; use Test::Exception; use Carp; use JSON; use JSON::Pointer; use JSON::Pointer::Exception qw(:all); my $json = JSON->new->allow_nonref; sub test_remove { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { my ($document, $pointer) = @$input{qw/document pointer/}; my ($patched_document, $removed) = JSON::Pointer->remove($document, $pointer); is_deeply( $patched_document, $expect->{document}, sprintf( "removed document (actual: %s. expect: %s)", $json->encode($patched_document), $json->encode($expect->{document}), ) ); is_deeply( $removed, $expect->{removed}, sprintf( "removed element (actual: %s. expect: %s)", $json->encode($removed), $json->encode($expect->{removed}), ) ); }; } sub test_remove_exception { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { my ($document, $pointer) = @$input{qw/document pointer/}; my $code = $expect->{code}; throws_ok { eval { my $patched_document = JSON::Pointer->remove($document, $pointer); }; if (my $e = $@) { is($e->code, $code, "code"); croak $e; } } "JSON::Pointer::Exception" => "throws_ok"; }; } # https://github.com/json-patch/json-patch-tests subtest "JSON Patch Appendix A. Example" => sub { test_remove "A.3 Removing an Object Member" => ( input => +{ document => +{ baz => "qux", foo => "bar", }, pointer => "/baz", }, expect => +{ removed => "qux", document => +{ foo => "bar" } }, ); test_remove "A.4 Removing an Array Element" => ( input => +{ document => +{ foo => ["bar", "qux", "baz"], }, pointer => "/foo/1", }, expect => +{ removed => "qux", document => +{ foo => ["bar", "baz"] } }, ); }; subtest "https://github.com/json-patch/json-patch-tests/blob/master/tests.json" => sub { test_remove "remove toplevel object field" => ( input => +{ document => +{ foo => 1, bar => [1, 2, 3, 4], }, pointer => "/bar", }, expect => +{ removed => [1, 2, 3, 4], document => +{ foo => 1, }, }, ); test_remove "remove nested object field" => ( input => +{ document => +{ foo => 1, baz => [ +{ qux => "hello" } ], }, pointer => "/baz/0/qux", }, expect => +{ removed => "hello", document => +{ foo => 1, baz => [ +{} ], }, }, ); }; subtest "misc" => sub { test_remove "remove whole document (object)" => ( input => +{ document => +{}, pointer => "", }, expect => +{ removed => +{}, document => undef, }, ); test_remove "remove whole document (array)" => ( input => +{ document => [], pointer => "", }, expect => +{ removed => [], document => undef, }, ); test_remove "remove whole document (string)" => ( input => +{ document => "foo", pointer => "", }, expect => +{ removed => "foo", document => undef, }, ); test_remove "remove specified element from array" => ( input => +{ document => [0, 1, 2, 3], pointer => "/2", }, expect => +{ removed => 2, document => [0, 1, 3], }, ); test_remove_exception "remove non-existent target location" => ( input => +{ document => [0, 1], pointer => "/2", }, expect => +{ code => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE }, ); }; done_testing; 006_replace.t1006441073730013260624 1161012563056503 22106 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/tuse strict; use warnings; use Test::More; use JSON; use JSON::Pointer; my $json = JSON->new->allow_nonref; sub test_replace { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { my ($document, $pointer, $value) = @$input{qw/document pointer value/}; my ($patched_document, $replaced) = JSON::Pointer->replace($document, $pointer, $value); is_deeply( $patched_document, $expect->{document}, sprintf( "replaced document (actual: %s. expect: %s)", $json->encode($patched_document), $json->encode($expect->{document}), ) ); is_deeply( $replaced, $expect->{replaced}, sprintf( "replaced element (actual: %s. expect: %s)", $json->encode($replaced), $json->encode($expect->{replaced}), ) ); }; } # https://github.com/json-patch/json-patch-tests subtest "JSON Patch Appendix A. Example" => sub { test_replace "A.5 Replacing a Value" => ( input => +{ document => +{ baz => "qux", foo => "bar", }, pointer => "/baz", value => "boo", }, expect => +{ replaced => "qux", document => +{ baz => "boo", foo => "bar" } }, ); }; subtest "https://github.com/json-patch/json-patch-tests/blob/master/tests.json" => sub { test_replace "Toplevel scalar values OK?" => ( input => +{ document => "foo", pointer => "", value => "bar", }, expect => +{ replaced => "foo", document => "bar", }, ); test_replace "top level object field" => ( input => +{ document => +{ foo => 1, baz => [ +{qux => "hello" } ] }, pointer => "/foo", value => [1, 2, 3, 4], }, expect => +{ replaced => 1, document => +{ foo => [1, 2, 3, 4], baz => [ +{qux => "hello" } ] }, }, ); test_replace "nested" => ( input => +{ document => +{ foo => [1, 2, 3, 4], baz => [ +{qux => "hello" } ] }, pointer => "/baz/0/qux", value => "world", }, expect => +{ replaced => "hello", document => +{ foo => [1, 2, 3, 4], baz => [ +{qux => "world" } ] }, }, ); test_replace "toplevel array element (string to string)" => ( input => +{ document => [ "foo" ], pointer => "/0", value => "bar", }, expect => +{ replaced => "foo", document => ["bar"], }, ); test_replace "toplevel array element (string to integer)" => ( input => +{ document => [ "" ], pointer => "/0", value => 0, }, expect => +{ replaced => "", document => [0], }, ); test_replace "toplevel array element (string to true)" => ( input => +{ document => [ "" ], pointer => "/0", value => JSON::true, }, expect => +{ replaced => "", document => [ JSON::true ], }, ); test_replace "toplevel array element (string to false)" => ( input => +{ document => [ "" ], pointer => "/0", value => JSON::false, }, expect => +{ replaced => "", document => [ JSON::false ], }, ); test_replace "toplevel array element (string to null)" => ( input => +{ document => [ "" ], pointer => "/0", value => undef, }, expect => +{ replaced => "", document => [ undef ], }, ); test_replace "value in array replace not flattened" => ( input => +{ document => [ "foo", "sil" ], pointer => "/1", value => ["bar", "baz"], }, expect => +{ replaced => "sil", document => [ "foo", ["bar", "baz"] ], }, ); }; subtest "misc" => sub { test_replace "Whole document (array to object)" => ( input => +{ document => [], pointer => "", value => +{ foo => 1 }, }, expect => +{ replaced => [], document => +{ foo => 1, }, }, ); test_replace "Whole document (object to array)" => ( input => +{ document => +{ foo => 1 }, pointer => "", value => [ 1, 2 ], }, expect => +{ replaced => +{ foo => 1, }, document => [1, 2], }, ); }; done_testing; 007_copy.t1006441073730013260624 236612563056503 21436 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/tuse strict; use warnings; use Test::More; use JSON; use JSON::Pointer; my $json = JSON->new->allow_nonref; sub test_copy { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { my ($document, $from_pointer, $to_pointer) = @$input{qw/document from path/}; my $patched_document = JSON::Pointer->copy($document, $from_pointer, $to_pointer); is_deeply( $patched_document, $expect->{patched}, sprintf( "copied document (actual: %s. expected: %s)", $json->encode($patched_document), $json->encode($expect->{patched}), ) ); }; } subtest "https://github.com/json-patch/json-patch-tests/blob/master/tests.json" => sub { test_copy "copy to new object field" => ( input => +{ document => +{ baz => [ +{ qux => "hello" } ], bar => 1, }, from => "/baz/0", path => "/boo", }, expect => +{ patched => +{ baz => [ +{ qux => "hello" } ], bar => 1, boo => +{ qux => "hello" }, }, }, ); }; done_testing; 008_move.t1006441073730013260624 602712563056503 21431 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/tuse strict; use warnings; use Test::More; use JSON; use JSON::Pointer; my $json = JSON->new->allow_nonref; sub test_move { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { my ($document, $from_pointer, $to_pointer) = @$input{qw/document from path/}; my $patched_document = JSON::Pointer->move($document, $from_pointer, $to_pointer); is_deeply( $patched_document, $expect->{patched}, sprintf( "copied document (actual: %s. expected: %s)", $json->encode($patched_document), $json->encode($expect->{patched}), ) ); }; } subtest "JSON Patch Appendix A. Example" => sub { test_move "A.6. Moving a Value" => ( input => +{ document => +{ "foo" => +{ "bar" => "baz", "waldo" => "fred", }, "qux" => +{ "corge" => "grault" } }, from => "/foo/waldo", path => "/qux/thud", }, expect => +{ patched => +{ "foo" => +{ "bar" => "baz", }, "qux" => +{ "corge" => "grault", "thud" => "fred", } }, }, ); test_move "A.6. Moving a Value" => ( input => +{ document => +{ "foo" => [ "all", "grass", "cows", "eat" ], }, from => "/foo/1", path => "/foo/3", }, expect => +{ patched => +{ "foo" => ["all", "cows", "eat", "grass"], }, }, ); }; subtest "https://github.com/json-patch/json-patch-tests/blob/master/tests.json" => sub { test_move "Move to same location has no effect" => ( input => +{ document => +{ foo => 1, }, from => "/foo", path => "/foo", }, expect => +{ patched => +{ foo => 1, }, }, ); test_move "Move to new object field" => ( input => +{ document => +{ foo => 1, baz => [ +{ qux => "hello", } ], }, from => "/foo", path => "/bar", }, expect => +{ patched => +{ bar => 1, baz => [ +{ qux => "hello", } ], }, }, ); test_move "Move to new array element" => ( input => +{ document => +{ bar => 1, baz => [ +{ qux => "hello", } ], }, from => "/baz/0/qux", path => "/baz/1", }, expect => +{ patched => +{ bar => 1, baz => [ +{}, "hello", ], }, }, ); }; done_testing; 009_test.t1006441073730013260624 1151712563056503 21463 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/tuse strict; use warnings; use Test::More; use JSON; use JSON::Pointer; my $json = JSON->new->allow_nonref; sub test_test { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { my ($document, $pointer, $value) = @$input{qw/document pointer value/}; my $actual = JSON::Pointer->test($document, $pointer, $value); is( $actual, $expect, sprintf( "test (document: %s. pointer: %s. value: %s)", $json->encode($document), $pointer, $json->encode($value) ) ); }; } subtest "JSON Patch Appendix A. Example" => sub { test_test "A.8. Testing a Value: Success (/0)" => ( input => +{ document => +{ baz => "qux", foo => ["a", 2, "c"] }, pointer => "/baz", value => "qux" }, expect => 1, ); test_test "A.8. Testing a Value: Success (/1)" => ( input => +{ document => +{ baz => "qux", foo => ["a", 2, "c"] }, pointer => "/foo/1", value => 2, }, expect => 1, ); test_test "A.8. Testing a Value: Error" => ( input => +{ document => +{ baz => "qux", }, pointer => "/baz", value => "bar", }, expect => 0, ); test_test "A.14. ~ Escape Ordering" => ( input => +{ document => +{ "/" => 9, "~1" => 10, }, pointer => "/~01", value => 10, }, expect => 1, ); test_test "A.15. Comparing Strings and Numbers" => ( input => +{ document => +{ "/" => 9, "~1" => 10, }, pointer => "/~01", value => "10", }, expect => 0, ); }; subtest "https://github.com/json-patch/json-patch-tests/blob/master/tests.json" => sub { test_test "test against implementation-specific numeric parsing" => ( input => +{ document => +{ le0 => "foo", }, pointer => "/le0", value => "foo", }, expect => 1, ); test_test "test with bad number should fail" => ( input => +{ document => [ "foo", "bar", ], pointer => "/le0", value => "bar", }, expect => 0, ); test_test "null value should still be valid obj property" => ( input => +{ document => +{ foo => undef }, pointer => "/foo", value => undef, }, expect => 1, ); test_test "test should pass - no error" => ( input => +{ document => +{ foo => +{ bar => [ 1, 2, 5, 4 ] }, }, pointer => "/foo", value => +{ bar => [ 1, 2, 5, 4 ] }, }, expect => 1, ); test_test "test op should fail" => ( input => +{ document => +{ foo => +{ bar => [ 1, 2, 5, 4 ] }, }, pointer => "/foo", value => +{ bar => [ 1, 2 ] }, }, expect => 0, ); test_test "Whole document" => ( input => +{ document => +{ foo => 1, }, pointer => "", value => +{ foo => 1, }, }, expect => 1, ); test_test "Empty-string element" => ( input => +{ document => +{ "" => 1, }, pointer => "/", value => 1, }, expect => 1, ); my $spec_document = decode_json(<< 'JSON'); { "foo": ["bar", "baz"], "": 0, "a/b": 1, "c%d": 2, "e^f": 3, "g|h": 4, "i\\j": 5, "k\"l": 6, " ": 7, "m~n": 8 } JSON my @spec_cases = ( +{ pointer => "/foo", value => [ "bar", "baz", ] }, +{ pointer => "/foo/0", value => "bar" }, +{ pointer => "/", value => 0, }, +{ pointer => "/a~1b", value => 1, }, +{ pointer => "/c\%d", value => 2, }, +{ pointer => "/e^f", value => 3, }, +{ pointer => "/g|h", value => 4, }, +{ pointer => "/i\\j", value => 5, }, +{ pointer => "/k\"l", value => 6, }, +{ pointer => "/ ", value => 7, }, +{ pointer => "/m~0n", value => 8, }, ); for my $spec_case (@spec_cases) { test_test sprintf("The value at %s equals %s", $spec_case->{pointer}, $json->encode($spec_case->{value})) => ( input => +{ document => $spec_document, pointer => $spec_case->{pointer}, value => $spec_case->{value}, }, expect => 1, ); } }; done_testing; 010_get_relative.t1006441073730013260624 643112563056503 23125 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/tuse strict; use warnings; use Test::More; use Test::Exception; use Carp; use JSON; use JSON::Pointer; use JSON::Pointer::Exception qw(:all); my $document = decode_json(<< "JSON"); { "foo": ["bar", "baz"], "highly": { "nested": { "objects": true } } } JSON sub test_get_relative { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { my $actual = JSON::Pointer->get_relative($document, @$input); is_deeply($actual, $expect, "target"); }; } sub test_get_relative_exception { my ($desc, %specs) = @_; my ($input, $expect) = @specs{qw/input expect/}; subtest $desc => sub { throws_ok { eval { JSON::Pointer->get_relative($document, @$input, +{ strict => 1 }); }; if (my $e = $@) { is($e->context->last_token, $expect->{last_token}, "last_token"); is($e->context->last_error, $expect->{last_error}, "last_error"); croak $e; } } "JSON::Pointer::Exception" => "throws_ok"; }; } subtest "Reletive JSON Pointer examples in 5.1" => sub { subtest "current pointer is /foo/1" => sub { my $current_pointer = "/foo/1"; test_get_relative "0" => ( input => [ $current_pointer, "0" ], expect => "baz", ); test_get_relative "1/0" => ( input => [ $current_pointer, "1/0" ], expect => "bar", ); test_get_relative "2/highly/nested/objects" => ( input => [ $current_pointer, "2/highly/nested/objects" ], expect => JSON::true, ); test_get_relative "0#" => ( input => [ $current_pointer, "0#" ], expect => 1, ); test_get_relative "1#" => ( input => [ $current_pointer, "1#" ], expect => "foo", ); }; subtest "current pointer is /highly/nested" => sub { my $current_pointer = "/highly/nested"; test_get_relative "0/objects" => ( input => [ $current_pointer, "0/objects" ], expect => JSON::true, ); test_get_relative "1/nested/objects" => ( input => [ $current_pointer, "1/nested/objects" ], expect => JSON::true, ); test_get_relative "2/foo/0" => ( input => [ $current_pointer, "2/foo/0" ], expect => "bar", ); test_get_relative "0#" => ( input => [ $current_pointer, "0#" ], expect => "nested", ); test_get_relative "1#" => ( input => [ $current_pointer, "1#" ], expect => "highly", ); }; }; subtest "Exceptions" => sub { test_get_relative_exception "Invalid relative json pointer" => ( input => ["/foo/1", "/invalid"], expect => +{ last_token => undef, last_error => ERROR_INVALID_POINTER_SYNTAX, }, ); test_get_relative_exception "Relative json pointer specified non reference value" => ( input => ["/foo/1", "3"], expect => +{ last_token => undef, last_error => ERROR_POINTER_REFERENCES_NON_EXISTENT_VALUE, }, ); }; done_testing; 89773.t1006441073730013260624 60012563056503 21171 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/t/rtuse strict; use warnings; use Test::More; use Test::Exception; use JSON::Pointer; use JSON; lives_and { my $json = JSON::decode_json('{"t": true}'); my $patched_json = JSON::Pointer->add($json, "/foo", "bar"); is_deeply( $patched_json, +{ t => JSON::true, foo => "bar" } ); } 'Cloned and added value'; done_testing; 001_unescape_reference_token.t1006441073730013260624 110412563056503 27012 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/t/syntax#!perl -w use strict; use Test::More; use JSON::Pointer::Syntax qw(unescape_reference_token); sub test_unescape_reference_token { my ($unescaped_reference_token, $expect, $desc) = @_; my $actual = unescape_reference_token($unescaped_reference_token); is($actual, $expect, $desc); } ### 4. Evaluation ### https://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-09#section-4 test_unescape_reference_token("~1", "/", "escaped /"); test_unescape_reference_token("~0", "~", "escaped ~"); test_unescape_reference_token("~01", "~1", "escaped ~ and 1"); done_testing; 002_escape_reference_token.t1006441073730013260624 106012563056503 26451 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/t/syntax#!perl -w use strict; use Test::More; use JSON::Pointer::Syntax qw(escape_reference_token); sub test_escape_reference_token { my ($escaped_reference_token, $expect, $desc) = @_; my $actual = escape_reference_token($escaped_reference_token); is($actual, $expect, $desc); } ### 4. Evaluation ### https://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-09#section-4 test_escape_reference_token("/", "~1", "escapes /"); test_escape_reference_token("~", "~0", "escapes ~"); test_escape_reference_token("~1", "~01", "escapes ~1"); done_testing; 003_tokenize.t1006441073730013260624 225012563056503 23626 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/t/syntax#!perl -w use strict; use Test::More; use Test::Exception; use JSON::Pointer::Syntax; sub test_tokenize { my ($pointer, $expect, $desc) = @_; my $actual = JSON::Pointer::Syntax->tokenize($pointer); is_deeply($actual, $expect, $desc); } sub test_tokenize_exception { my ($pointer, $desc) = @_; throws_ok { JSON::Pointer::Syntax->tokenize($pointer); } "JSON::Pointer::Exception", $desc; } subtest "JSON Pointer Section 5 examples" => sub { test_tokenize('', [], q{""}); test_tokenize('/foo', ['foo'], q{"/foo"}); test_tokenize('/foo/0', ['foo', 0], q{"/foo/0"}); test_tokenize('/', [''], q{"/"}); test_tokenize('/a~1b', ['a/b'], q{"/a~1b"}); test_tokenize('/c%d', ['c%d'], q{"/c%d"}); test_tokenize('/e^f', ['e^f'], q{"/e^f"}); test_tokenize('/g|h', ['g|h'], q{"/g|h"}); test_tokenize('/i\\j', ['i\\j'], q{"/i\\j"}); test_tokenize('/k"l', ['k"l'], q{"/k\"l"}); test_tokenize('/ ', [' '], q{"/ "}); test_tokenize('/m~0n', ['m~n'], q{"/m~0n"}); }; subtest "Exceptions" => sub { test_tokenize_exception("~", q{"~"}); test_tokenize_exception("##", q{"##"}); test_tokenize_exception(" ", q{" "}); }; done_testing; 004_as_pointer.t1006441073730013260624 177012563056503 24150 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/t/syntax#!perl -w use strict; use Test::More; use JSON::Pointer::Syntax; sub test_as_pointer { my ($tokens, $expect, $desc) = @_; subtest $desc => sub { my $actual = JSON::Pointer::Syntax->as_pointer($tokens); is($actual, $expect, "arrayref"); $actual = JSON::Pointer::Syntax->as_pointer(@$tokens); is($actual, $expect, "array"); } } subtest "JSON Pointer Section 5 examples" => sub { test_as_pointer([], '', q{""}); test_as_pointer(['foo'], '/foo', q{"/foo"}); test_as_pointer(['foo', 0], '/foo/0', q{"/foo/0"}); test_as_pointer([''], '/', q{"/"}); test_as_pointer(['a/b'], '/a~1b', q{"/a~1b"}); test_as_pointer(['c%d'], '/c%d', q{"/c%d"}); test_as_pointer(['e^f'], '/e^f', q{"/e^f"}); test_as_pointer(['g|h'], '/g|h', q{"/g|h"}); test_as_pointer(['i\\j'], '/i\\j', q{"/i\\j"}); test_as_pointer(['k"l'], '/k"l', q{"/k\"l"}); test_as_pointer([' '], '/ ', q{"/ "}); test_as_pointer(['m~n'], '/m~0n', q{"/m~0n"}); }; done_testing; 005_is_array_numeric_index.t1006441073730013260624 121712563056503 26524 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/t/syntax#!perl -w use strict; use Test::More; use JSON::Pointer::Syntax qw(is_array_numeric_index); sub test_is_array_numeric_index { my ($token, $expect, $desc) = @_; my $actual = is_array_numeric_index($token); is($actual, $expect, $desc); } subtest "valid numeric index" => sub { test_is_array_numeric_index("0", 1, q{"0"}); test_is_array_numeric_index("23", 1, q{"23"}); }; subtest "invalid numeric index" => sub { test_is_array_numeric_index("-23", 0, q{"-23"}); test_is_array_numeric_index("foo", 0, q{"foo"}); test_is_array_numeric_index("-", 0, q{"-"}); test_is_array_numeric_index("", 0, q{""}); }; done_testing; perlcritic.t1006441073730013260624 141712563056503 22422 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/xtuse strict; use Test::More; eval q{ use Perl::Critic 1.105; use Test::Perl::Critic -profile => \do { local $/; }; }; plan skip_all => "Test::Perl::Critic is not available." if $@; all_critic_ok('lib'); __DATA__ exclude=ProhibitStringyEval ProhibitExplicitReturnUndef RequireBarewordIncludes [TestingAndDebugging::ProhibitNoStrict] allow=refs [TestingAndDebugging::RequireUseStrict] equivalent_modules = Mouse Mouse::Role Mouse::Exporter Mouse::Util Mouse::Util::TypeConstraints Moose Moose::Role Moose::Exporter Moose::Util::TypeConstraints Any::Moose [TestingAndDebugging::RequireUseWarnings] equivalent_modules = Mouse Mouse::Role Mouse::Exporter Mouse::Util Mouse::Util::TypeConstraints Moose Moose::Role Moose::Exporter Moose::Util::TypeConstraints Any::Moose pod.t1006441073730013260624 23512563056503 21021 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/xt#!perl -w use strict; use Test::More; eval q{use Test::Pod 1.14}; plan skip_all => 'Test::Pod 1.14 required for testing POD' if $@; all_pod_files_ok(); podcoverage.t1006441073730013260624 36112563056503 22535 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/xt#!perl -w use Test::More; eval q{use Test::Pod::Coverage 1.04}; plan skip_all => 'Test::Pod::Coverage 1.04 required for testing POD coverage' if $@; all_pod_coverage_ok({ also_private => [qw(unimport BUILD DEMOLISH init_meta)], }); podsynopsis.t1006441073730013260624 24012563056503 22625 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07/xt#!perl -w use strict; use Test::More; eval q{use Test::Synopsis}; plan skip_all => 'Test::Synopsis required for testing SYNOPSIS' if $@; all_synopsis_ok(); META.yml1006441073730013260624 274612563056503 20721 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07--- abstract: 'A Perl implementation of JSON Pointer (RFC6901)' author: - 'Toru Yamaguchi ' build_requires: Test::Exception: '0.31' Test::More: '0.98' configure_requires: CPAN::Meta: '0' CPAN::Meta::Prereqs: '0' Module::Build: '0.38' dynamic_config: 0 generated_by: 'Minilla/v1.0.0, CPAN::Meta::Converter version 2.141520' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: JSON-Pointer no_index: directory: - t - xt - inc - share - eg - examples - author - builder provides: JSON::Pointer: file: lib/JSON/Pointer.pm version: '0.07' JSON::Pointer::Context: file: lib/JSON/Pointer/Context.pm version: '0.07' JSON::Pointer::Exception: file: lib/JSON/Pointer/Exception.pm version: '0.07' JSON::Pointer::Syntax: file: lib/JSON/Pointer/Syntax.pm version: '0.07' requires: B: '0' Carp: '1.20' Class::Accessor::Lite: '0.05' Clone: '0.36' Exporter: '0' JSON: '2.53' URI::Escape: '3.31' perl: '5.008001' resources: bugtracker: https://github.com/zigorou/perl-json-pointer/issues homepage: https://github.com/zigorou/perl-json-pointer repository: git://github.com/zigorou/perl-json-pointer.git version: '0.07' x_contributors: - 'aoneko ' - 'Kensaku Araga ' - 'Ichito Nagata ' - 'Hiroyoshi Houchi ' - 'Toru Yamaguchi ' MANIFEST1006441073730013260624 113312563056503 20566 0ustar00yamaguchi.toruDENA\Domain Users000000000000JSON-Pointer-0.07Build.PL Changes LICENSE META.json README.md cpanfile lib/JSON/Pointer.pm lib/JSON/Pointer/Context.pm lib/JSON/Pointer/Exception.pm lib/JSON/Pointer/Syntax.pm minil.toml t/000_load.t t/001_traverse.t t/002_get.t t/003_mojo_json_pointer_compat.t t/004_add.t t/005_remove.t t/006_replace.t t/007_copy.t t/008_move.t t/009_test.t t/010_get_relative.t t/rt/89773.t t/syntax/001_unescape_reference_token.t t/syntax/002_escape_reference_token.t t/syntax/003_tokenize.t t/syntax/004_as_pointer.t t/syntax/005_is_array_numeric_index.t xt/perlcritic.t xt/pod.t xt/podcoverage.t xt/podsynopsis.t META.yml MANIFEST