Perinci-Object-0.310/0000755000175000017500000000000013362047057011751 5ustar s1s1Perinci-Object-0.310/MANIFEST0000644000175000017500000000115413362047057013103 0ustar s1s1# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.009. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/Perinci/Object.pm lib/Perinci/Object/EnvResult.pm lib/Perinci/Object/EnvResultMulti.pm lib/Perinci/Object/EnvResultTable.pm lib/Perinci/Object/Function.pm lib/Perinci/Object/Metadata.pm lib/Perinci/Object/Package.pm lib/Perinci/Object/ResMeta.pm lib/Perinci/Object/Variable.pm t/00-compile.t t/EnvResult.t t/EnvResultMulti.t t/Function.t t/Metadata.t t/Package.t t/ResMeta.t t/Variable.t t/author-critic.t t/author-pod-coverage.t t/author-pod-syntax.t weaver.ini Perinci-Object-0.310/weaver.ini0000644000175000017500000000002513362047057013740 0ustar s1s1[@Author::PERLANCAR] Perinci-Object-0.310/README0000644000175000017500000001113113362047057012626 0ustar s1s1NAME Perinci::Object - Object-oriented interface for Rinci metadata VERSION This document describes version 0.310 of Perinci::Object (from Perl distribution Perinci-Object), released on 2018-10-18. SYNOPSIS use Perinci::Object; # automatically exports risub(), rivar(), ripkg(), # envres(), envresmulti(), envrestable(), riresmeta() use Data::Dump; # for dd() # OO interface to function metadata. my $risub = risub { v => 1.1, summary => 'Calculate foo and bar', "summary.alt.lang.id_ID" => 'Menghitung foo dan bar', args => { a1 => { schema => 'int*' }, a2 => { schema => 'str' } }, features => { pure=>1 }, }; dd $risub->type, # "function" $risub->v, # 1.1 $risub->arg('a1'), # { schema=>'int*' } $risub->arg('a3'), # undef $risub->feature('pure'), # 1 $risub->feature('foo'), # undef $risub->langprop('summary'), # 'Calculate foo and bar' $risub->langprop({lang=>'id_ID'}, 'summary'), # 'Menghitung foo dan bar' # setting arg and property $risub->arg('a3', 'array'); # will actually fail for 1.0 metadata $risub->feature('foo', 2); # ditto # OO interface to variable metadata my $rivar = rivar { ... }; # OO interface to package metadata my $ripkg = ripkg { ... }; # OO interface to enveloped result my $envres = envres [200, "OK", [1, 2, 3]]; dd $envres->is_success, # 1 $envres->status, # 200 $envres->message, # "OK" $envres->result, # [1, 2, 3] $envres->meta; # undef # setting status, message, result, extra $envres->status(404); $envres->message('Not found'); $envres->result(undef); $envres->meta({errno=>-100}); # OO interface to function/method result metadata my $riresmeta = riresmeta { ... }; # an example of using envresmulti() sub myfunc { ... my $envres = envresmulti(); # add result for each item $envres->add_result(200, "OK", {item_id=>1}); $envres->add_result(202, "OK", {item_id=>2, note=>"blah"}); $envres->add_result(404, "Not found", {item_id=>3}); ... # finally, return the result return $envres->as_struct; } # an example of using envrestable() sub myfunc { ... my $envres = envrestable(); $envres->add_field('foo'); $envres->add_field('bar'); ... return $envres->as_struct; } DESCRIPTION Rinci works using pure data structures, but sometimes it's convenient to have an object-oriented interface (wrapper) for those data. This module provides just that. FUNCTIONS rimeta $meta => OBJECT Exported by default. A shortcut for Perinci::Object::Metadata->new($meta). risub $meta => OBJECT Exported by default. A shortcut for Perinci::Object::Function->new($meta). rivar $meta => OBJECT Exported by default. A shortcut for Perinci::Object::Variable->new($meta). ripkg $meta => OBJECT Exported by default. A shortcut for Perinci::Object::Package->new($meta). envres $res => OBJECT Exported by default. A shortcut for Perinci::Object::EnvResult->new($res). envresmulti $res => OBJECT Exported by default. A shortcut for Perinci::Object::EnvResultMulti->new($res). envrestable $res => OBJECT Exported by default. A shortcut for Perinci::Object::EnvResultTable->new($res). riresmeta $resmeta => OBJECT Exported by default. A shortcut for Perinci::Object::ResMeta->new($res). HOMEPAGE Please visit the project's homepage at . SOURCE Source repository is at . BUGS Please report any bugs or feature requests on the bugtracker website When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. SEE ALSO Rinci AUTHOR perlancar COPYRIGHT AND LICENSE This software is copyright (c) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Perinci-Object-0.310/META.json0000644000175000017500000005112613362047057013377 0ustar s1s1{ "abstract" : "Object-oriented interface for Rinci metadata", "author" : [ "perlancar " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Perinci-Object", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::Perl::Critic" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08" }, "x_copypaste" : { "String::Trim::More" : "0.02" }, "x_spec" : { "Rinci" : "v1.1.83" } }, "runtime" : { "requires" : { "Exporter" : "5.57", "parent" : "0", "perl" : "5.010001", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::Exception" : "0", "Test::More" : "0.98" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-Object" }, "homepage" : "https://metacpan.org/release/Perinci-Object", "repository" : { "type" : "git", "url" : "git://github.com/perlancar/perl-Perinci-Object.git", "web" : "https://github.com/perlancar/perl-Perinci-Object" } }, "version" : "0.310", "x_Dist_Zilla" : { "perl" : { "version" : "5.026000" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." } }, "name" : "@Author::PERLANCAR/@Filter/GatherDir", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Author::PERLANCAR/@Filter/PruneCruft", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@Author::PERLANCAR/@Filter/ManifestSkip", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::PERLANCAR/@Filter/MetaYAML", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::PERLANCAR/@Filter/License", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Author::PERLANCAR/@Filter/PodCoverageTests", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::PERLANCAR/@Filter/PodSyntaxTests", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::ExtraTests", "name" : "@Author::PERLANCAR/@Filter/ExtraTests", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Author::PERLANCAR/@Filter/ExecDir", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Author::PERLANCAR/@Filter/ShareDir", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@Author::PERLANCAR/@Filter/MakeMaker", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::PERLANCAR/@Filter/Manifest", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::PERLANCAR/@Filter/ConfirmRelease", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Author::PERLANCAR/ExecDir script", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::PERLANCAR::BeforeBuild", "name" : "@Author::PERLANCAR/PERLANCAR::BeforeBuild", "version" : "0.593" }, { "class" : "Dist::Zilla::Plugin::Rinci::AbstractFromMeta", "name" : "@Author::PERLANCAR/Rinci::AbstractFromMeta", "version" : "0.10" }, { "class" : "Dist::Zilla::Plugin::PodnameFromFilename", "name" : "@Author::PERLANCAR/PodnameFromFilename", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::PERLANCAR::EnsurePrereqToSpec", "name" : "@Author::PERLANCAR/PERLANCAR::EnsurePrereqToSpec", "version" : "0.060" }, { "class" : "Dist::Zilla::Plugin::PERLANCAR::MetaResources", "name" : "@Author::PERLANCAR/PERLANCAR::MetaResources", "version" : "0.040" }, { "class" : "Dist::Zilla::Plugin::CheckChangeLog", "name" : "@Author::PERLANCAR/CheckChangeLog", "version" : "0.05" }, { "class" : "Dist::Zilla::Plugin::CheckMetaResources", "name" : "@Author::PERLANCAR/CheckMetaResources", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::CheckSelfDependency", "config" : { "Dist::Zilla::Plugin::CheckSelfDependency" : { "finder" : [ ":InstallModules" ] }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000033", "version" : "0.006" } }, "name" : "@Author::PERLANCAR/CheckSelfDependency", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::CopyrightYearFromGit", "name" : "@Author::PERLANCAR/CopyrightYearFromGit", "version" : "0.003" }, { "class" : "Dist::Zilla::Plugin::IfBuilt", "name" : "@Author::PERLANCAR/IfBuilt", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::PERLANCAR/MetaJSON", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::PERLANCAR/MetaConfig", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@Author::PERLANCAR/Authority", "version" : "1.009" }, { "class" : "Dist::Zilla::Plugin::OurDate", "name" : "@Author::PERLANCAR/OurDate", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::OurDist", "name" : "@Author::PERLANCAR/OurDist", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::PERLANCAR::OurPkgVersion", "name" : "@Author::PERLANCAR/PERLANCAR::OurPkgVersion", "version" : "0.04" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Author::PERLANCAR/Name", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Author::PERLANCAR/Version", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::PERLANCAR/prelude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Author::PERLANCAR/Leftovers", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::PERLANCAR/postlude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Completion::GetoptLongComplete", "name" : "@Author::PERLANCAR/Completion::GetoptLongComplete", "version" : "0.08" }, { "class" : "Pod::Weaver::Section::Completion::GetoptLongSubcommand", "name" : "@Author::PERLANCAR/Completion::GetoptLongSubcommand", "version" : "0.04" }, { "class" : "Pod::Weaver::Section::Completion::GetoptLongMore", "name" : "@Author::PERLANCAR/Completion::GetoptLongMore", "version" : "0.001" }, { "class" : "Pod::Weaver::Section::Homepage::DefaultCPAN", "name" : "@Author::PERLANCAR/Homepage::DefaultCPAN", "version" : "0.05" }, { "class" : "Pod::Weaver::Section::Source::DefaultGitHub", "name" : "@Author::PERLANCAR/Source::DefaultGitHub", "version" : "0.07" }, { "class" : "Pod::Weaver::Section::Bugs::DefaultRT", "name" : "@Author::PERLANCAR/Bugs::DefaultRT", "version" : "0.06" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Author::PERLANCAR/Authors", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Author::PERLANCAR/Legal", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::Rinci", "name" : "@Author::PERLANCAR/Rinci", "version" : "0.77" }, { "class" : "Pod::Weaver::Plugin::AppendPrepend", "name" : "@Author::PERLANCAR/AppendPrepend", "version" : "0.01" }, { "class" : "Pod::Weaver::Plugin::EnsureUniqueSections", "name" : "@Author::PERLANCAR/EnsureUniqueSections", "version" : "0.163250" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Author::PERLANCAR/SingleEncoding", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::PERLANCAR::SortSections", "name" : "@Author::PERLANCAR/PERLANCAR::SortSections", "version" : "0.06" } ] } }, "name" : "@Author::PERLANCAR/PodWeaver", "version" : "4.008" }, { "class" : "Dist::Zilla::Plugin::PruneFiles", "name" : "@Author::PERLANCAR/PruneFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Pod2Readme", "name" : "@Author::PERLANCAR/Pod2Readme", "version" : "0.004" }, { "class" : "Dist::Zilla::Plugin::Rinci::AddPrereqs", "name" : "@Author::PERLANCAR/Rinci::AddPrereqs", "version" : "0.142" }, { "class" : "Dist::Zilla::Plugin::Rinci::AddToDb", "name" : "@Author::PERLANCAR/Rinci::AddToDb", "version" : "0.01" }, { "class" : "Dist::Zilla::Plugin::Rinci::Validate", "name" : "@Author::PERLANCAR/Rinci::Validate", "version" : "0.24" }, { "class" : "Dist::Zilla::Plugin::SetScriptShebang", "name" : "@Author::PERLANCAR/SetScriptShebang", "version" : "0.01" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : 0, "fail_on_warning" : "author", "fake_home" : 0, "filename" : "t/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "test", "script_finder" : [ ":PerlExecFiles" ], "skips" : [], "switch" : [] } }, "name" : "@Author::PERLANCAR/Test::Compile", "version" : "2.056" }, { "class" : "Dist::Zilla::Plugin::Test::Perl::Critic", "name" : "@Author::PERLANCAR/Test::Perl::Critic", "version" : "3.001" }, { "class" : "Dist::Zilla::Plugin::Test::Rinci", "name" : "@Author::PERLANCAR/Test::Rinci", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::StaticInstall", "config" : { "Dist::Zilla::Plugin::StaticInstall" : { "dry_run" : 0, "mode" : "on" } }, "name" : "@Author::PERLANCAR/StaticInstall", "version" : "0.010" }, { "class" : "Dist::Zilla::Plugin::EnsureSQLSchemaVersionedTest", "name" : "@Author::PERLANCAR/EnsureSQLSchemaVersionedTest", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::Acme::CPANModules::Blacklist", "name" : "@Author::PERLANCAR/Acme::CPANModules::Blacklist", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::Prereqs::EnsureVersion", "name" : "@Author::PERLANCAR/Prereqs::EnsureVersion", "version" : "0.050" }, { "class" : "Dist::Zilla::Plugin::Prereqs::CheckCircular", "name" : "@Author::PERLANCAR/Prereqs::CheckCircular", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN::WWWPAUSESimple", "name" : "@Author::PERLANCAR/UploadToCPAN::WWWPAUSESimple", "version" : "0.04" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "TestRequires", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "Prereqs", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "x_spec" } }, "name" : "DevelopX_spec", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "x_copypaste" } }, "name" : "DevelopX_copypaste", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.009" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.009" } }, "x_authority" : "cpan:PERLANCAR", "x_serialization_backend" : "Cpanel::JSON::XS version 3.0233", "x_static_install" : 1 } Perinci-Object-0.310/Makefile.PL0000644000175000017500000000253013362047057013723 0ustar s1s1# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.009. use strict; use warnings; use 5.010001; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Object-oriented interface for Rinci metadata", "AUTHOR" => "perlancar ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Perinci-Object", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.010001", "NAME" => "Perinci::Object", "PREREQ_PM" => { "Exporter" => "5.57", "parent" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::Exception" => 0, "Test::More" => "0.98" }, "VERSION" => "0.310", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Exporter" => "5.57", "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::Exception" => 0, "Test::More" => "0.98", "parent" => 0, "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Perinci-Object-0.310/META.yml0000644000175000017500000003312113362047057013222 0ustar s1s1--- abstract: 'Object-oriented interface for Rinci metadata' author: - 'perlancar ' build_requires: File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Test::Exception: '0' Test::More: '0.98' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Perinci-Object requires: Exporter: '5.57' parent: '0' perl: '5.010001' strict: '0' warnings: '0' resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-Object homepage: https://metacpan.org/release/Perinci-Object repository: git://github.com/perlancar/perl-Perinci-Object.git version: '0.310' x_Dist_Zilla: perl: version: '5.026000' plugins: - class: Dist::Zilla::Plugin::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: [] exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . name: '@Author::PERLANCAR/@Filter/GatherDir' version: '6.009' - class: Dist::Zilla::Plugin::PruneCruft name: '@Author::PERLANCAR/@Filter/PruneCruft' version: '6.009' - class: Dist::Zilla::Plugin::ManifestSkip name: '@Author::PERLANCAR/@Filter/ManifestSkip' version: '6.009' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::PERLANCAR/@Filter/MetaYAML' version: '6.009' - class: Dist::Zilla::Plugin::License name: '@Author::PERLANCAR/@Filter/License' version: '6.009' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Author::PERLANCAR/@Filter/PodCoverageTests' version: '6.009' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::PERLANCAR/@Filter/PodSyntaxTests' version: '6.009' - class: Dist::Zilla::Plugin::ExtraTests name: '@Author::PERLANCAR/@Filter/ExtraTests' version: '6.009' - class: Dist::Zilla::Plugin::ExecDir name: '@Author::PERLANCAR/@Filter/ExecDir' version: '6.009' - class: Dist::Zilla::Plugin::ShareDir name: '@Author::PERLANCAR/@Filter/ShareDir' version: '6.009' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Author::PERLANCAR/@Filter/MakeMaker' version: '6.009' - class: Dist::Zilla::Plugin::Manifest name: '@Author::PERLANCAR/@Filter/Manifest' version: '6.009' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::PERLANCAR/@Filter/ConfirmRelease' version: '6.009' - class: Dist::Zilla::Plugin::ExecDir name: '@Author::PERLANCAR/ExecDir script' version: '6.009' - class: Dist::Zilla::Plugin::PERLANCAR::BeforeBuild name: '@Author::PERLANCAR/PERLANCAR::BeforeBuild' version: '0.593' - class: Dist::Zilla::Plugin::Rinci::AbstractFromMeta name: '@Author::PERLANCAR/Rinci::AbstractFromMeta' version: '0.10' - class: Dist::Zilla::Plugin::PodnameFromFilename name: '@Author::PERLANCAR/PodnameFromFilename' version: '0.02' - class: Dist::Zilla::Plugin::PERLANCAR::EnsurePrereqToSpec name: '@Author::PERLANCAR/PERLANCAR::EnsurePrereqToSpec' version: '0.060' - class: Dist::Zilla::Plugin::PERLANCAR::MetaResources name: '@Author::PERLANCAR/PERLANCAR::MetaResources' version: '0.040' - class: Dist::Zilla::Plugin::CheckChangeLog name: '@Author::PERLANCAR/CheckChangeLog' version: '0.05' - class: Dist::Zilla::Plugin::CheckMetaResources name: '@Author::PERLANCAR/CheckMetaResources' version: '0.001' - class: Dist::Zilla::Plugin::CheckSelfDependency config: Dist::Zilla::Plugin::CheckSelfDependency: finder: - ':InstallModules' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000033' version: '0.006' name: '@Author::PERLANCAR/CheckSelfDependency' version: '0.011' - class: Dist::Zilla::Plugin::CopyrightYearFromGit name: '@Author::PERLANCAR/CopyrightYearFromGit' version: '0.003' - class: Dist::Zilla::Plugin::IfBuilt name: '@Author::PERLANCAR/IfBuilt' version: '0.03' - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::PERLANCAR/MetaJSON' version: '6.009' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::PERLANCAR/MetaConfig' version: '6.009' - class: Dist::Zilla::Plugin::Authority name: '@Author::PERLANCAR/Authority' version: '1.009' - class: Dist::Zilla::Plugin::OurDate name: '@Author::PERLANCAR/OurDate' version: '0.03' - class: Dist::Zilla::Plugin::OurDist name: '@Author::PERLANCAR/OurDist' version: '0.02' - class: Dist::Zilla::Plugin::PERLANCAR::OurPkgVersion name: '@Author::PERLANCAR/PERLANCAR::OurPkgVersion' version: '0.04' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.015' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.015' - class: Pod::Weaver::Section::Name name: '@Author::PERLANCAR/Name' version: '4.015' - class: Pod::Weaver::Section::Version name: '@Author::PERLANCAR/Version' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::PERLANCAR/prelude' version: '4.015' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.015' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.015' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.015' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.015' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.015' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.015' - class: Pod::Weaver::Section::Leftovers name: '@Author::PERLANCAR/Leftovers' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::PERLANCAR/postlude' version: '4.015' - class: Pod::Weaver::Section::Completion::GetoptLongComplete name: '@Author::PERLANCAR/Completion::GetoptLongComplete' version: '0.08' - class: Pod::Weaver::Section::Completion::GetoptLongSubcommand name: '@Author::PERLANCAR/Completion::GetoptLongSubcommand' version: '0.04' - class: Pod::Weaver::Section::Completion::GetoptLongMore name: '@Author::PERLANCAR/Completion::GetoptLongMore' version: '0.001' - class: Pod::Weaver::Section::Homepage::DefaultCPAN name: '@Author::PERLANCAR/Homepage::DefaultCPAN' version: '0.05' - class: Pod::Weaver::Section::Source::DefaultGitHub name: '@Author::PERLANCAR/Source::DefaultGitHub' version: '0.07' - class: Pod::Weaver::Section::Bugs::DefaultRT name: '@Author::PERLANCAR/Bugs::DefaultRT' version: '0.06' - class: Pod::Weaver::Section::Authors name: '@Author::PERLANCAR/Authors' version: '4.015' - class: Pod::Weaver::Section::Legal name: '@Author::PERLANCAR/Legal' version: '4.015' - class: Pod::Weaver::Plugin::Rinci name: '@Author::PERLANCAR/Rinci' version: '0.77' - class: Pod::Weaver::Plugin::AppendPrepend name: '@Author::PERLANCAR/AppendPrepend' version: '0.01' - class: Pod::Weaver::Plugin::EnsureUniqueSections name: '@Author::PERLANCAR/EnsureUniqueSections' version: '0.163250' - class: Pod::Weaver::Plugin::SingleEncoding name: '@Author::PERLANCAR/SingleEncoding' version: '4.015' - class: Pod::Weaver::Plugin::PERLANCAR::SortSections name: '@Author::PERLANCAR/PERLANCAR::SortSections' version: '0.06' name: '@Author::PERLANCAR/PodWeaver' version: '4.008' - class: Dist::Zilla::Plugin::PruneFiles name: '@Author::PERLANCAR/PruneFiles' version: '6.009' - class: Dist::Zilla::Plugin::Pod2Readme name: '@Author::PERLANCAR/Pod2Readme' version: '0.004' - class: Dist::Zilla::Plugin::Rinci::AddPrereqs name: '@Author::PERLANCAR/Rinci::AddPrereqs' version: '0.142' - class: Dist::Zilla::Plugin::Rinci::AddToDb name: '@Author::PERLANCAR/Rinci::AddToDb' version: '0.01' - class: Dist::Zilla::Plugin::Rinci::Validate name: '@Author::PERLANCAR/Rinci::Validate' version: '0.24' - class: Dist::Zilla::Plugin::SetScriptShebang name: '@Author::PERLANCAR/SetScriptShebang' version: '0.01' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '0' fail_on_warning: author fake_home: 0 filename: t/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: test script_finder: - ':PerlExecFiles' skips: [] switch: [] name: '@Author::PERLANCAR/Test::Compile' version: '2.056' - class: Dist::Zilla::Plugin::Test::Perl::Critic name: '@Author::PERLANCAR/Test::Perl::Critic' version: '3.001' - class: Dist::Zilla::Plugin::Test::Rinci name: '@Author::PERLANCAR/Test::Rinci' version: '0.03' - class: Dist::Zilla::Plugin::StaticInstall config: Dist::Zilla::Plugin::StaticInstall: dry_run: 0 mode: on name: '@Author::PERLANCAR/StaticInstall' version: '0.010' - class: Dist::Zilla::Plugin::EnsureSQLSchemaVersionedTest name: '@Author::PERLANCAR/EnsureSQLSchemaVersionedTest' version: '0.03' - class: Dist::Zilla::Plugin::Acme::CPANModules::Blacklist name: '@Author::PERLANCAR/Acme::CPANModules::Blacklist' version: '0.001' - class: Dist::Zilla::Plugin::Prereqs::EnsureVersion name: '@Author::PERLANCAR/Prereqs::EnsureVersion' version: '0.050' - class: Dist::Zilla::Plugin::Prereqs::CheckCircular name: '@Author::PERLANCAR/Prereqs::CheckCircular' version: '0.006' - class: Dist::Zilla::Plugin::UploadToCPAN::WWWPAUSESimple name: '@Author::PERLANCAR/UploadToCPAN::WWWPAUSESimple' version: '0.04' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: TestRequires version: '6.009' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: Prereqs version: '6.009' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: x_spec name: DevelopX_spec version: '6.009' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: x_copypaste name: DevelopX_copypaste version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.009' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.009' x_authority: cpan:PERLANCAR x_serialization_backend: 'YAML::Tiny version 1.70' x_static_install: 1 Perinci-Object-0.310/lib/0000755000175000017500000000000013362047057012517 5ustar s1s1Perinci-Object-0.310/lib/Perinci/0000755000175000017500000000000013362047057014110 5ustar s1s1Perinci-Object-0.310/lib/Perinci/Object.pm0000644000175000017500000001306713362047057015663 0ustar s1s1## no critic: (Modules::ProhibitAutomaticExportation) package Perinci::Object; our $DATE = '2018-10-18'; # DATE our $VERSION = '0.310'; # VERSION use 5.010001; use strict; use warnings; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(rimeta risub rivar ripkg envres envresmulti envrestable riresmeta); sub rimeta { require Perinci::Object::Metadata; Perinci::Object::Metadata->new(@_); } sub risub { require Perinci::Object::Function; Perinci::Object::Function->new(@_); } sub rivar { require Perinci::Object::Variable; Perinci::Object::Variable->new(@_); } sub ripkg { require Perinci::Object::Package; Perinci::Object::Package->new(@_); } sub envres { require Perinci::Object::EnvResult; Perinci::Object::EnvResult->new(@_); } sub envresmulti { require Perinci::Object::EnvResultMulti; Perinci::Object::EnvResultMulti->new(@_); } sub envrestable { require Perinci::Object::EnvResultTable; Perinci::Object::EnvResultTable->new(@_); } sub riresmeta { require Perinci::Object::ResMeta; Perinci::Object::ResMeta->new(@_); } 1; # ABSTRACT: Object-oriented interface for Rinci metadata __END__ =pod =encoding UTF-8 =head1 NAME Perinci::Object - Object-oriented interface for Rinci metadata =head1 VERSION This document describes version 0.310 of Perinci::Object (from Perl distribution Perinci-Object), released on 2018-10-18. =head1 SYNOPSIS use Perinci::Object; # automatically exports risub(), rivar(), ripkg(), # envres(), envresmulti(), envrestable(), riresmeta() use Data::Dump; # for dd() # OO interface to function metadata. my $risub = risub { v => 1.1, summary => 'Calculate foo and bar', "summary.alt.lang.id_ID" => 'Menghitung foo dan bar', args => { a1 => { schema => 'int*' }, a2 => { schema => 'str' } }, features => { pure=>1 }, }; dd $risub->type, # "function" $risub->v, # 1.1 $risub->arg('a1'), # { schema=>'int*' } $risub->arg('a3'), # undef $risub->feature('pure'), # 1 $risub->feature('foo'), # undef $risub->langprop('summary'), # 'Calculate foo and bar' $risub->langprop({lang=>'id_ID'}, 'summary'), # 'Menghitung foo dan bar' # setting arg and property $risub->arg('a3', 'array'); # will actually fail for 1.0 metadata $risub->feature('foo', 2); # ditto # OO interface to variable metadata my $rivar = rivar { ... }; # OO interface to package metadata my $ripkg = ripkg { ... }; # OO interface to enveloped result my $envres = envres [200, "OK", [1, 2, 3]]; dd $envres->is_success, # 1 $envres->status, # 200 $envres->message, # "OK" $envres->result, # [1, 2, 3] $envres->meta; # undef # setting status, message, result, extra $envres->status(404); $envres->message('Not found'); $envres->result(undef); $envres->meta({errno=>-100}); # OO interface to function/method result metadata my $riresmeta = riresmeta { ... }; # an example of using envresmulti() sub myfunc { ... my $envres = envresmulti(); # add result for each item $envres->add_result(200, "OK", {item_id=>1}); $envres->add_result(202, "OK", {item_id=>2, note=>"blah"}); $envres->add_result(404, "Not found", {item_id=>3}); ... # finally, return the result return $envres->as_struct; } # an example of using envrestable() sub myfunc { ... my $envres = envrestable(); $envres->add_field('foo'); $envres->add_field('bar'); ... return $envres->as_struct; } =head1 DESCRIPTION L works using pure data structures, but sometimes it's convenient to have an object-oriented interface (wrapper) for those data. This module provides just that. =head1 FUNCTIONS =head2 rimeta $meta => OBJECT Exported by default. A shortcut for Perinci::Object::Metadata->new($meta). =head2 risub $meta => OBJECT Exported by default. A shortcut for Perinci::Object::Function->new($meta). =head2 rivar $meta => OBJECT Exported by default. A shortcut for Perinci::Object::Variable->new($meta). =head2 ripkg $meta => OBJECT Exported by default. A shortcut for Perinci::Object::Package->new($meta). =head2 envres $res => OBJECT Exported by default. A shortcut for Perinci::Object::EnvResult->new($res). =head2 envresmulti $res => OBJECT Exported by default. A shortcut for Perinci::Object::EnvResultMulti->new($res). =head2 envrestable $res => OBJECT Exported by default. A shortcut for Perinci::Object::EnvResultTable->new($res). =head2 riresmeta $resmeta => OBJECT Exported by default. A shortcut for Perinci::Object::ResMeta->new($res). =head1 HOMEPAGE Please visit the project's homepage at L. =head1 SOURCE Source repository is at L. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 SEE ALSO L =head1 AUTHOR perlancar =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Perinci-Object-0.310/lib/Perinci/Object/0000755000175000017500000000000013362047057015316 5ustar s1s1Perinci-Object-0.310/lib/Perinci/Object/Function.pm0000644000175000017500000000776013362047057017453 0ustar s1s1package Perinci::Object::Function; our $DATE = '2018-10-18'; # DATE our $VERSION = '0.310'; # VERSION use 5.010; use strict; use warnings; use parent qw(Perinci::Object::Metadata); sub type { "function" } # convenience for accessing features property sub feature { my $self = shift; my $name = shift; if (@_) { die "1.0 can't set feature" if $self->v eq 1.0; my $value = shift; ${$self}->{features} //= {}; my $old = ${$self}->{features}{$name}; ${$self}->{features}{$name} = $value; return $old; } else { ${$self}->{features}{$name}; } } sub features { my $self = shift; ${$self}->{features} // {}; } # transaction can be used to emulate dry run, by calling with -tx_action => # 'check_state' only sub can_dry_run { my $self = shift; my $ff = ${$self}->{features} // {}; $ff->{dry_run} // $ff->{tx} && $ff->{tx}{v} == 2; } sub default_dry_run { my $self = shift; my $ff = ${$self}->{features} // {}; ref($ff->{dry_run}) eq 'HASH' && $ff->{dry_run}{default}; } # convenience for accessing args property sub arg { my $self = shift; my $name = shift; if (@_) { die "1.0 can't set arg" if $self->v eq 1.0; my $value = shift; ${$self}->{args} //= {}; my $old = ${$self}->{args}{$name}; ${$self}->{args}{$name} = $value; return $old; } else { ${$self}->{args}{$name}; } } 1; # ABSTRACT: Represent function metadata __END__ =pod =encoding UTF-8 =head1 NAME Perinci::Object::Function - Represent function metadata =head1 VERSION This document describes version 0.310 of Perinci::Object::Function (from Perl distribution Perinci-Object), released on 2018-10-18. =head1 SYNOPSIS use Perinci::Object; $SPEC{foo} = { v => 1.1, args => { b => {schema=>'int', req=>0} }, features => {idempotent=>1}, }; my $risub = risub $SPEC{foo}; print $risub->feature('idempotent'), # 1 $risub->arg('b')->{req}, # 0 $risub->arg('a'); # undef =head1 DESCRIPTION This class provides an object-oriented interface for function metadata. =head1 METHODS =head2 new($meta) => OBJECT Create a new object from $meta. If $meta is undef, creates an empty metadata. =head2 $risub->type => str Will return C. =head2 $risub->features => HASH Return the C property. =head2 $risub->feature(NAME[, VALUE]) Get or set named feature (B property in metadata). If a feature doesn't exist, undef will be returned. =head2 $risub->can_dry_run => BOOL Check whether function can do dry run, either from the C feature, or from the C feature. (Transaction can be used to emulate dry run, by calling the function with C<< -tx_action => 'check_state' >> only.) =head2 $risub->default_dry_run => BOOL Starting from Rinci 1.1.83, the C feature property can be a hash instead of a bool, and can contain this pair C<< default=>1 >> to specify that dry-run mode should be the default operation (e.g. for safety). =head2 $risub->arg(NAME[, VALUE]) Get or set argument (B property in metadata). If an argument doesn't exist, undef will be returned. =head1 HOMEPAGE Please visit the project's homepage at L. =head1 SOURCE Source repository is at L. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 SEE ALSO L =head1 AUTHOR perlancar =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Perinci-Object-0.310/lib/Perinci/Object/Variable.pm0000644000175000017500000000255313362047057017406 0ustar s1s1package Perinci::Object::Variable; our $DATE = '2018-10-18'; # DATE our $VERSION = '0.310'; # VERSION use 5.010; use strict; use warnings; use parent qw(Perinci::Object::Metadata); sub type { "variable" } 1; # ABSTRACT: Represent variable metadata __END__ =pod =encoding UTF-8 =head1 NAME Perinci::Object::Variable - Represent variable metadata =head1 VERSION This document describes version 0.310 of Perinci::Object::Variable (from Perl distribution Perinci-Object), released on 2018-10-18. =head1 METHODS =head2 $rivar->type => str Will return C. =head1 HOMEPAGE Please visit the project's homepage at L. =head1 SOURCE Source repository is at L. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR perlancar =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Perinci-Object-0.310/lib/Perinci/Object/EnvResultMulti.pm0000644000175000017500000001024413362047057020617 0ustar s1s1package Perinci::Object::EnvResultMulti; our $DATE = '2018-10-18'; # DATE our $VERSION = '0.310'; # VERSION use 5.010; use strict; use warnings; use parent qw(Perinci::Object::EnvResult); sub new { my ($class, $res) = @_; $res //= [200, "Success/no items"]; my $obj = \$res; bless $obj, $class; } sub add_result { my ($self, $status, $message, $extra) = @_; my $num_ok = 0; my $num_nok = 0; push @{ ${$self}->[3]{results} }, {status=>$status, message=>$message, %{ $extra // {} }}; for (@{ ${$self}->[3]{results} // [] }) { if ($_->{status} =~ /\A(2|304)/) { $num_ok++; } else { $num_nok++; } } if ($num_ok) { if ($num_nok) { ${$self}->[0] = 207; ${$self}->[1] = "Partial success"; } else { my $overall_status = 200; my %statuses; for (@{ ${$self}->[3]{results} // []}) { $statuses{ $_->{status} }++; } if (keys %statuses == 1) { my @tmp = keys %statuses; $overall_status = $tmp[0]; } ${$self}->[0] = $overall_status; ${$self}->[1] = "All success"; } } else { ${$self}->[0] = $status; ${$self}->[1] = $message; } } 1; # ABSTRACT: Represent enveloped result (multistatus) __END__ =pod =encoding UTF-8 =head1 NAME Perinci::Object::EnvResultMulti - Represent enveloped result (multistatus) =head1 VERSION This document describes version 0.310 of Perinci::Object::EnvResultMulti (from Perl distribution Perinci-Object), released on 2018-10-18. =head1 SYNOPSIS use Perinci::Object::EnvResultMulti; use Data::Dump; # for dd() sub myfunc { ... # if unspecified, the default status will be [200, "Success/no items"] my $envres = Perinci::Object::EnvResultMulti->new; # then you can add result for each item $envres->add_result(200, "OK", {item_id=>1}); $envres->add_result(202, "OK", {item_id=>2, note=>"blah"}); $envres->add_result(404, "Not found", {item_id=>3}); ... # if you add a success status, the overall status will still be 200 # if you add a non-success staus, the overall status will be 207, or # the non-success status (if no success has been added) # finally, return the result return $envres->as_struct; # the result from the above will be: [207, "Partial success", undef, # {results => [ # {success=>200, message=>"OK", item_id=>1}, # {success=>201, message=>"OK", item_id=>2, note=>"blah"}, # {success=>404, message=>"Not found", item_id=>3}, # ]}] } # myfunc =head1 DESCRIPTION This class is a subclass of L and provides a convenience method when you want to use multistatus/detailed per-item results (specified in L 1.1.63: C result metadata property). In this case, response status can be 200, 207, or non-success. As you add more per-item results, this class will set/update the overall response status for you. =head1 METHODS =head2 new($res) => OBJECT Create a new object from C<$res> enveloped result array. If C<$res> is not specified, the default is C<< [200, "Success/no items"] >>. =head2 $envres->add_result($status, $message, \%extra) Add an item result. =head1 HOMEPAGE Please visit the project's homepage at L. =head1 SOURCE Source repository is at L. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 SEE ALSO L L =head1 AUTHOR perlancar =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Perinci-Object-0.310/lib/Perinci/Object/Metadata.pm0000644000175000017500000001201113362047057017367 0ustar s1s1package Perinci::Object::Metadata; our $DATE = '2018-10-18'; # DATE our $VERSION = '0.310'; # VERSION use 5.010; use strict; use warnings; # BEGIN COPY-PASTE FROM String::Trim::More sub __trim_blank_lines { local $_ = shift; return $_ unless defined; s/\A(?:\n\s*)+//; s/(?:\n\s*){2,}\z/\n/; $_; } # END COPY-PASTE sub new { my ($class, $meta) = @_; $meta //= {}; my $obj = \$meta; bless $obj, $class; } sub v { my $self = shift; ${$self}->{v} // 1.0; } sub type { die "BUG: type() must be subclassed"; } sub as_struct { my $self = shift; ${$self}; } sub langprop { my $self = shift; my $opts; if (ref($_[0]) eq 'HASH') { $opts = shift; } else { $opts = {}; } my $prop = shift; my $deflang = ${$self}->{default_lang} // "en_US"; my $olang = $opts->{lang} || $ENV{LANGUAGE} || $ENV{LANG} || $deflang; $olang =~ s/\W.+//; # change "en_US.UTF-8" to "en_US" $olang = "en_US" if $olang eq 'C'; (my $olang2 = $olang) =~ s/\A([a-z]{2})_[A-Z]{2}\z/$1/; # change "en_US" to "en" my $mark = $opts->{mark_different_lang} // 1; #print "deflang=$deflang, olang=$olang, mark_different_lang=$mark\n"; my @k; if ($olang eq $deflang) { @k = ([$olang, $prop, 0]); } else { @k = ( [$olang, "$prop.alt.lang.$olang", 0], ([$olang2, "$prop.alt.lang.$olang2", 0]) x !!($olang2 ne $olang), [$deflang, $prop, $mark], ); } my $v; GET: for my $k (@k) { #print "k=".join(", ", @$k)."\n"; $v = ${$self}->{$k->[1]}; if (defined $v) { if ($k->[2]) { my $has_nl = $v =~ s/\n\z//; $v = "{$olang|$k->[0] $v}" . ($has_nl ? "\n" : ""); } $v = __trim_blank_lines($v); last GET; } } if (@_) { # set value ${$self}->{$k[0][1]} = $_[0]; } $v; } sub name { my $self = shift; my $opts; if (@_ && ref($_[0]) eq 'HASH') { $opts = shift; } else { $opts = {}; } $self->langprop($opts, "name", @_); } sub caption { my $self = shift; my $opts; if (@_ && ref($_[0]) eq 'HASH') { $opts = shift; } else { $opts = {}; } $self->langprop($opts, "caption", @_); } sub summary { my $self = shift; my $opts; if (@_ && ref($_[0]) eq 'HASH') { $opts = shift; } else { $opts = {}; } $self->langprop($opts, "summary", @_); } sub description { my $self = shift; my $opts; if (@_ && ref($_[0]) eq 'HASH') { $opts = shift; } else { $opts = {}; } $self->langprop($opts, "description", @_); } 1; # ABSTRACT: Base class for Perinci::Object metadata classes __END__ =pod =encoding UTF-8 =head1 NAME Perinci::Object::Metadata - Base class for Perinci::Object metadata classes =head1 VERSION This document describes version 0.310 of Perinci::Object::Metadata (from Perl distribution Perinci-Object), released on 2018-10-18. =head1 METHODS =head2 new => obj Constructor. =head2 v => float Get version. =head2 as_struct => hash Get underlying data structure. =head2 type => str Return type (e.g. C, C). =head2 langprop([ \%opts, ]$prop[, $new_value]) Get or set property value in the specified language (i.e., either in C or C properties). Known options: =over 4 =item * lang => STR Defaults to metadata's C (which in turns default to C if unspecified). =item * mark_different_lang => BOOL (defaults to 1) If set to true, text with different language than the language requested will be marked, e.g. C<"I love you"> requested in Indonesian language where the value for that language is unavailable will result in C<"{en_US I love you}"> being returned. =back =head2 name([ $new_value ]) => $value Get or set C property. Will call C. =head2 summary([ $new_value ]) => $value Get or set C property. Will call C. =head2 description([ $new_value ]) => $value Get or set C property. Will call C. =head2 caption([ $new_value ]) => $value Get or set C property. Will call C. =head1 HOMEPAGE Please visit the project's homepage at L. =head1 SOURCE Source repository is at L. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR perlancar =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Perinci-Object-0.310/lib/Perinci/Object/ResMeta.pm0000644000175000017500000000260613362047057017220 0ustar s1s1package Perinci::Object::ResMeta; our $DATE = '2018-10-18'; # DATE our $VERSION = '0.310'; # VERSION use 5.010; use strict; use warnings; use parent qw(Perinci::Object::Metadata); sub type { "resmeta" } 1; # ABSTRACT: Represent function/method result metadata __END__ =pod =encoding UTF-8 =head1 NAME Perinci::Object::ResMeta - Represent function/method result metadata =head1 VERSION This document describes version 0.310 of Perinci::Object::ResMeta (from Perl distribution Perinci-Object), released on 2018-10-18. =head1 METHODS =head2 $riresmeta->type => str Will return C. =head1 HOMEPAGE Please visit the project's homepage at L. =head1 SOURCE Source repository is at L. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR perlancar =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Perinci-Object-0.310/lib/Perinci/Object/EnvResult.pm0000644000175000017500000001034013362047057017601 0ustar s1s1package Perinci::Object::EnvResult; our $DATE = '2018-10-18'; # DATE our $VERSION = '0.310'; # VERSION use 5.010; use strict; use warnings; sub new { my ($class, $res) = @_; $res //= [0, "", undef]; my $obj = \$res; bless $obj, $class; } sub new_ok { my $class = shift; my $res = [200, "OK"]; if (@_) { push @$res, $_[0]; } $class->new($res); } sub status { my ($self, $new) = @_; if (defined $new) { die "Status must be an integer between 100 and 555" unless int($new) eq $new && $new >= 100 && $new <= 555; my $old = ${$self}->[0]; ${$self}->[0] = $new; return $old; } ${$self}->[0]; } sub message { my ($self, $new) = @_; if (defined $new) { die "Extra must be a string" if ref($new); my $old = ${$self}->[1]; ${$self}->[1] = $new; return $old; } ${$self}->[1]; } # avoid 'result' as this is ambiguous (the enveloped one? the naked one?). even # avoid 'enveloped' (the payload being enveloped? the enveloped result # (envelope+result inside)?) sub payload { my ($self, $new) = @_; if (defined $new) { my $old = ${$self}->[2]; ${$self}->[2] = $new; return $old; } ${$self}->[2]; } sub meta { my ($self, $new) = @_; if (defined $new) { die "Extra must be a hashref" unless ref($new) eq 'HASH'; my $old = ${$self}->[3]; ${$self}->[3] = $new; return $old; } ${$self}->[3]; } sub is_success { my ($self) = @_; my $status = ${$self}->[0]; $status >= 200 && $status <= 299; } sub as_struct { my ($self) = @_; ${$self}; } 1; # ABSTRACT: Represent enveloped result __END__ =pod =encoding UTF-8 =head1 NAME Perinci::Object::EnvResult - Represent enveloped result =head1 VERSION This document describes version 0.310 of Perinci::Object::EnvResult (from Perl distribution Perinci-Object), released on 2018-10-18. =head1 SYNOPSIS use Perinci::Object::EnvResult; use Data::Dump; # for dd() my $envres = Perinci::Object::EnvResult->new([200, "OK", [1, 2, 3]]); dd $envres->is_success, # 1 $envres->status, # 200 $envres->message, # "OK" $envres->payload, # [1, 2, 3] $envres->meta, # undef $envres->as_struct; # [200, "OK", [1, 2, 3]] # setting status, message, result, extra $envres->status(404); $envres->message('Not found'); $envres->payload(undef); $envres->meta({errno=>-100}); # shortcut: create a new OK result ([200, "OK"] or [200, "OK", $payload]) $envres = Perinci::Object::EnvResult->new_ok(); $envres = Perinci::Object::EnvResult->new_ok(42); =head1 DESCRIPTION This class provides an object-oriented interface for enveloped result (see L for more details). =head1 METHODS =head2 new($res) => OBJECT Create a new object from $res enveloped result array. =head2 new_ok([ $actual_res ]) => OBJECT Shortcut for C<< new([200,"OK",$actual_res]) >>, or just C<< new([200,"OK"]) >> if C<$actual_res> is not specified. =head2 $envres->status Get or set status (the 1st element). =head2 $envres->message Get or set message (the 2nd element). =head2 $envres->payload Get or set the actual payload (the 3rd element). =head2 $envres->meta Get or set result metadata (the 4th element). =head2 $envres->as_struct Return the represented data structure. =head2 $envres->is_success True if status is between 200-299. =head1 HOMEPAGE Please visit the project's homepage at L. =head1 SOURCE Source repository is at L. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 SEE ALSO L =head1 AUTHOR perlancar =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Perinci-Object-0.310/lib/Perinci/Object/Package.pm0000644000175000017500000000254413362047057017214 0ustar s1s1package Perinci::Object::Package; our $DATE = '2018-10-18'; # DATE our $VERSION = '0.310'; # VERSION use 5.010; use strict; use warnings; use parent qw(Perinci::Object::Metadata); sub type { "package" } 1; # ABSTRACT: Represent package metadata __END__ =pod =encoding UTF-8 =head1 NAME Perinci::Object::Package - Represent package metadata =head1 VERSION This document describes version 0.310 of Perinci::Object::Package (from Perl distribution Perinci-Object), released on 2018-10-18. =head1 METHODS =head2 $ripkg->type => str Will return C. =head1 HOMEPAGE Please visit the project's homepage at L. =head1 SOURCE Source repository is at L. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR perlancar =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Perinci-Object-0.310/lib/Perinci/Object/EnvResultTable.pm0000644000175000017500000000425513362047057020561 0ustar s1s1package Perinci::Object::EnvResultTable; our $DATE = '2018-10-18'; # DATE our $VERSION = '0.310'; # VERSION use 5.010; use strict; use warnings; use parent qw(Perinci::Object::EnvResult); sub add_field { my ($self, $name, %attrs) = @_; ${$self}->[3]{'table.fields'} //= []; push @{ ${$self}->[3]{'table.fields'} }, $name; } 1; # ABSTRACT: Represent enveloped result (table) __END__ =pod =encoding UTF-8 =head1 NAME Perinci::Object::EnvResultTable - Represent enveloped result (table) =head1 VERSION This document describes version 0.310 of Perinci::Object::EnvResultTable (from Perl distribution Perinci-Object), released on 2018-10-18. =head1 SYNOPSIS use Perinci::Object::EnvResultTable; sub myfunc { ... my $envres = Perinci::Object::EnvResultTable->new; # add fields $envres->add_field('foo'); $envres->add_field('foo'); # finally, return the result return $envres->as_struct; } =head1 DESCRIPTION This class is a subclass of L and provides convenience methods when you want to return table data. =head1 METHODS =head2 new($res) => OBJECT Create a new object from C<$res> enveloped result array. =head2 $envres->add_field($name, %attrs) Add a table field. This will create/push an entry to the C result metadata array. =head1 HOMEPAGE Please visit the project's homepage at L. =head1 SOURCE Source repository is at L. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 SEE ALSO L L =head1 AUTHOR perlancar =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Perinci-Object-0.310/Changes0000644000175000017500000001131313362047057013243 0ustar s1s10.310 2018-10-18 (PERLANCAR) - [Bugfix] envresmulti(): If all statuses are 304, return final status as 304 instead of 200. 0.30 2017-02-03 (PERLANCAR) - EnvResultMulti: Allow add_result() to override status/message keys. 0.29 2016-12-28 (PERLANCAR) - No functional changes. - [dist] Fix expressing follow-spec prereq relationship with x_spec, and copy-paste prereq relationship with x_copypaste. 0.28 2016-12-27 (PERLANCAR) - No functional changes. - [dist] Use _SPEC and _COPYPASTE prefixes for dependencies. 0.27 2016-12-26 (PERLANCAR) - Downgrade prereq String::Trim::More from RuntimeRequires to DevelopSuggests, copy-paste routine trim_blank_lines(). 0.26 2016-12-15 (PERLANCAR) - risub: Add method default_dry_run to check default dry-run mode (Rinci 1.1.83). 0.25 2016-11-21 (PERLANCAR) - [doc] Fix typo in Synopsis. - Add class: Perinci::Object::EnvResultTable and envrestable() as shortcut to instantiate this class. 0.24 2015-09-03 (PERLANCAR) - No functional changes. - [dist] Move spec prereqs from RuntimeRequires to DevelopRecommends to reduce deps but still allow indicating spec requirement. 0.23 2015-09-03 (PERLANCAR) - Assume LANG=C will use the default en_US, this fixes lots of '{en_US ...}' marks on lots of dists using this. 0.22 2015-09-03 (PERLANCAR) - Mark requested language to aid debugging. 0.21 2014-12-11 (PERLANCAR) - No functional changes. - [ux] Add example of using riresmulti() in Synopsis. 0.20 2014-12-10 (PERLANCAR) - No functional changes. - Use new name of renamed/split module SHARYANTO::String::Util -> String::Trim::More. 0.19 2014-11-07 (PERLANCAR) - Regard status 304 as success. 0.18 2014-10-29 (PERLANCAR) - [Incompatible change] envresmulti(): change 'response' terminology to 'result' to follow Rinci 1.1.63, so now the method add_response() is renamed to add_result(), and the result metadata property is now the correct 'results' and not 'responses'. 0.17 2014-10-28 (PERLANCAR) [INCOMPATIBLE CHANGES] - langprop(): \%opts is now optional first argument instead of the second. This change is to make the syntax of setting a langprop consistent with others, e.g. $rimeta->langprop("summary", "new value") and $rimeta->langprop({lang=>"id_ID"}, "summary", "Nilai baru"). [ENHANCEMENTS] - Allow setting a langprop. - Add convenient methods: name(), caption(), summary(), description(). They all use langprop() under the hood. 0.16 2014-10-28 (PERLANCAR) - Add envresmulti() (Perinci::Object::EnvResultMulti). 0.15 2014-10-20 (PERLANCAR) - No functional changes. - Fix typo in test which caused CT failure reports. 0.14 2014-10-16 (PERLANCAR) - langprop(): Search PROP.alt.lang.xx in addition to PROP.alt.lang.xx_XX. - Rename module files. 0.13 2014-01-03 (SHARYANTO) - Trim language from locale env (e.g. "en_US.UTF-8" to "en_US") to avoid unnecessary mark. 0.12 2013-12-11 (SHARYANTO) - langprop() now observes LANG/LANGUAGE environment. 0.11 2012-08-29 (SHARYANTO) - function: Add features() and can_dry_run(). 0.10 2012-03-23 (SHARYANTO) - No functional changes. Resolve circular dependency problem with SHARYANTO-Utils by splitting SHARYANTO::String::Util to its own dist. [RT#75987, thanks Slaven] 0.09 2012-03-22 (SHARYANTO) - No functional changes. Try to work around dependency problem (some systems cannot find SHARYANTO::String::Util, new in SHARYANTO-Utils 0.16+). 0.08 2012-03-20 (SHARYANTO) - No functional changes. Fix Perl version dependency ('parent' requires 5.10.1). 0.07 2012-03-15 (SHARYANTO) [FIXES] - Fix behavior of langprop(), now language defaults to metadata's 'default_lang' property. [INCOMPATIBLE CHANGES] - langprop(): rename option 'mark_fallback_text' to 'mark_different_lang'. 0.06 2012-03-15 (SHARYANTO) [ENHANCEMENTS] - Add 'rimeta'. 0.05 2012-03-15 (SHARYANTO) [INCOMPATIBLE CHANGES] - Rename 'rires' to 'envres' (to avoid confusion with the new 'riresmeta'). Rename its extra() method to meta(). [ENHANCEMENTS] - Add 'riresmeta' - Add langprop() method. 0.04 2012-01-26 (SHARYANTO) - First release, rename from Sub-Spec-Object to Perinci-Object. Now follows Rinci (currently 1.1) specification instead of Sub::Spec 1.0 (but still supports old sub specs). Perinci-Object-0.310/t/0000755000175000017500000000000013362047057012214 5ustar s1s1Perinci-Object-0.310/t/Package.t0000644000175000017500000000033413362047057013734 0ustar s1s1#!perl use 5.010; use strict; use warnings; use Test::More 0.96; use Test::Exception; use Perinci::Object; my $ripkg = ripkg { v=>1.1 }; is($ripkg->type, "package", "type"); is($ripkg->v, 1.1, "v"); done_testing(); Perinci-Object-0.310/t/EnvResult.t0000644000175000017500000000203513362047057014330 0ustar s1s1#!perl use 5.010; use strict; use warnings; use Test::More 0.96; use Perinci::Object; my $envres = envres [200, "OK", [1, 2, 3]]; is_deeply($envres->as_struct, [200, "OK", [1, 2, 3]], "as_struct 1"); is($envres->status, 200, "status"); is($envres->status(250), 200, "status (set) 1"); is($envres->status, 250, "status (set) 2"); ok($envres->is_success, "is_success 1"); is($envres->message, "OK", "message"); is($envres->message("Not found"), "OK", "message (set) 1"); is($envres->message, "Not found", "message (set) 2"); is($envres->status(404), 250, "status (set) 3"); ok(!$envres->is_success, "is_success 2"); is_deeply($envres->payload, [1,2,3], "payload"); is_deeply($envres->payload([4,5,6]), [1,2,3], "payload (set) 1"); is_deeply($envres->payload, [4,5,6], "payload (set) 2"); ok(!$envres->meta, "extra"); ok(!$envres->meta({errno=>-100}), "meta (set) 1"); is_deeply($envres->meta, {errno=>-100}, "meta (set) 2"); is_deeply($envres->as_struct, [404, "Not found", [4, 5, 6], {errno=>-100}], "as_struct 2"); done_testing(); Perinci-Object-0.310/t/00-compile.t0000644000175000017500000000327113362047057014251 0ustar s1s1use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.056 use Test::More; plan tests => 9 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Perinci/Object.pm', 'Perinci/Object/EnvResult.pm', 'Perinci/Object/EnvResultMulti.pm', 'Perinci/Object/EnvResultTable.pm', 'Perinci/Object/Function.pm', 'Perinci/Object/Metadata.pm', 'Perinci/Object/Package.pm', 'Perinci/Object/ResMeta.pm', 'Perinci/Object/Variable.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; Perinci-Object-0.310/t/Function.t0000644000175000017500000000447613362047057014201 0ustar s1s1#!perl use 5.010; use strict; use warnings; use Test::More 0.96; use Test::Exception; use Perinci::Object; my $risub = risub { }; is($risub->type, "function", "type"); # --- is($risub->v, 1.0, "1.0 v"); ok(!$risub->feature('foo'), "1.0 feature"); ok(!$risub->arg('j'), "1.0 arg"); dies_ok { $risub->feature('foo', 2) } "1.0 can't set feature"; dies_ok { $risub->arg('j', 'str') } "1.0 can't set arg"; $risub = risub { features => {undo=>1}, args => {i=>'int'} }; is($risub->feature('undo'), 1, "1.0 feature (2)"); is($risub->arg('i'), 'int', "1.0 arg (2)"); # --- $risub = risub { v=>1.1 }; is($risub->v, 1.1, "1.1 v"); ok(!$risub->feature('foo'), "1.1 feature"); ok(!$risub->arg('j'), "1.1 arg"); ok(!$risub->feature('foo', 2), "1.1 feature, set returns old value"); is($risub->feature('foo'), 2, "1.1 feature, set"); ok(!$risub->arg('j', {schema=>'str'}), '1.1 arg, set returns old value'); is_deeply($risub->arg('j'), {schema=>'str'}, "1.1 arg, set") or diag explain $risub->arg('j'); is_deeply($risub->as_struct, {v=>1.1, features=>{foo=>2}, args=>{j=>{schema=>'str'}}}, "1.1 as_struct") or diag explain $risub->as_struct; $risub = risub { v=>1.1, features => {undo=>1}, args => {i=>{schema=>'int'}} }; is($risub->feature('undo'), 1, "1.1 feature (2)"); is_deeply($risub->arg('i'), {schema=>'int'}, "1.1 arg (2)"); subtest "features" => sub { $risub = risub { v=>1.1 }; is_deeply($risub->features, {}, "empty"); $risub = risub { v=>1.1, features => {undo=>1} }; is_deeply($risub->features, {undo=>1}, "empty"); }; subtest "can_dry_run" => sub { $risub = risub { v=>1.1, features => {dry_run=>1}}; ok($risub->can_dry_run, "from dry_run feature"); $risub = risub { v=>1.1, features => {tx=>{v=>2}}}; ok($risub->can_dry_run, "from tx feature"); }; subtest "default_dry_run" => sub { $risub = risub { v=>1.1, features => {dry_run=>0}}; ok(!$risub->default_dry_run, "dry_run=0 -> no"); $risub = risub { v=>1.1, features => {dry_run=>1}}; ok(!$risub->default_dry_run, "dry_run=1 -> no"); $risub = risub { v=>1.1, features => {dry_run=>{default=>0}}}; ok(!$risub->default_dry_run, "dry_run={default=>0} -> no"); $risub = risub { v=>1.1, features => {dry_run=>{default=>1}}}; ok( $risub->default_dry_run, "dry_run={default=>1} -> yes"); }; # --- done_testing(); Perinci-Object-0.310/t/Metadata.t0000644000175000017500000000771313362047057014131 0ustar s1s1#!perl use 5.010; use strict; use warnings; use Test::More 0.96; use Test::Exception; use Perinci::Object; my $rimeta = rimeta { v => 1.1, summary => "English", "summary.alt.lang.id_ID" => "Bahasa", description => "English d", "description.alt.lang.id" => "Bahasa d", }; { local $ENV{LANG}; local $ENV{LANGUAGE}; is($rimeta->langprop("summary"), "English", "doesn't specify default_lang -> en_US"); } { local $ENV{LANG} = "en_US.UTF-8"; local $ENV{LANGUAGE}; is($rimeta->langprop("summary"), "English", "value from LANG is trimmed"); } { local $ENV{LANG}; local $ENV{LANGUAGE} = "en_US.UTF-8"; is($rimeta->langprop("summary"), "English", "value from LANG is trimmed"); } is($rimeta->langprop({lang=>"id_ID"}, "summary"), "Bahasa", "specify lang id_ID"); is($rimeta->langprop({lang=>"id"}, "description"), "Bahasa d", "specify lang id"); { local $ENV{LANG}; local $ENV{LANGUAGE} = "id_ID"; is($rimeta->langprop("summary"), "Bahasa", "specify lang id_ID via env LANGUAGE"); } { local $ENV{LANG} = "id_ID"; local $ENV{LANGUAGE}; is($rimeta->langprop("summary"), "Bahasa", "specify lang id_ID via env LANG"); } is($rimeta->langprop({lang=>"fr_FR"}, "summary"), "{fr_FR|en_US English}", "specify non-existent lang fr_FR -> default_lang + marked"); $rimeta = rimeta { v => 1.1, default_lang => "id_ID", description => "Ba\nhasa\n", "description.alt.lang.en_US" => "Eng\nlish\n", }; { local $ENV{LANG}; local $ENV{LANGUAGE}; is($rimeta->langprop("description"), "Ba\nhasa\n", "default_lang id_ID"); } is($rimeta->langprop({lang=>"id_ID"}, "description"), "Ba\nhasa\n", "specify lang=id_ID"); is($rimeta->langprop({lang=>"en_US"}, "description"), "Eng\nlish\n", "specify lang=en_US"); is($rimeta->langprop({lang=>"fr_FR"}, "description"), "{fr_FR|id_ID Ba\nhasa}\n", "specify non-existent lang fr_FR -> default_lang id_ID + marked"); is($rimeta->langprop({lang=>"fr_FR", mark_different_lang=>0}, "description"), "Ba\nhasa\n", "mark_different_lang=0"); subtest set => sub { local $ENV{LANG}; local $ENV{LANGUAGE}; my $rimeta = rimeta({ v => 1.1, summary => "English", }); $rimeta->langprop("summary", "language"); is_deeply($$rimeta, {v=>1.1, summary=>"language"}); $rimeta->langprop({lang=>"id_ID"}, "summary", "bahasa"); is_deeply($$rimeta, {v=>1.1, summary=>"language", "summary.alt.lang.id_ID"=>"bahasa"}); }; subtest "langprop shortcuts (summary, et al)" => sub { local $ENV{LANG}; local $ENV{LANGUAGE}; my $rimeta = rimeta({ v => 1.1, name => "n.en", "name.alt.lang.id_ID" => "n.id", caption => "c.en", "caption.alt.lang.id_ID" => "c.id", summary => "s.en", "summary.alt.lang.id_ID" => "s.id", description => "d.en", "description.alt.lang.id_ID" => "d.id", }); is($rimeta->name, "n.en"); is($rimeta->name({lang=>"id_ID"}), "n.id"); $rimeta->name("n2.en"); is($rimeta->name, "n2.en"); $rimeta->name({lang=>"id_ID"}, "n2.id"); is($rimeta->name({lang=>"id_ID"}), "n2.id"); is($rimeta->caption, "c.en"); is($rimeta->caption({lang=>"id_ID"}), "c.id"); $rimeta->caption("c2.en"); is($rimeta->caption, "c2.en"); $rimeta->caption({lang=>"id_ID"}, "c2.id"); is($rimeta->caption({lang=>"id_ID"}), "c2.id"); is($rimeta->summary, "s.en"); is($rimeta->summary({lang=>"id_ID"}), "s.id"); $rimeta->summary("s2.en"); is($rimeta->summary, "s2.en"); $rimeta->summary({lang=>"id_ID"}, "s2.id"); is($rimeta->summary({lang=>"id_ID"}), "s2.id"); is($rimeta->description, "d.en"); is($rimeta->description({lang=>"id_ID"}), "d.id"); $rimeta->description("d2.en"); is($rimeta->description, "d2.en"); $rimeta->description({lang=>"id_ID"}, "d2.id"); is($rimeta->description({lang=>"id_ID"}), "d2.id"); }; done_testing; Perinci-Object-0.310/t/EnvResultMulti.t0000644000175000017500000000475113362047057015352 0ustar s1s1#!perl use 5.010; use strict; use warnings; use Test::More 0.96; use Perinci::Object; my $envres = envresmulti; is($envres->status, 200, "Default status is 200"); subtest "all success" => sub { my $envres = envresmulti; $envres->add_result(200, "OK", {item_id=>1}); $envres->add_result(202, "OK", {item_id=>2, note=>"blah"}); $envres->add_result(304, "Not modified", {item_id=>3}); my $res = $envres->as_struct; is($res->[0], 200, "final status"); is_deeply($res->[3]{results}, [ {status=>200, message=>"OK", item_id=>1}, {status=>202, message=>"OK", item_id=>2, note=>"blah"}, {status=>304, message=>"Not modified", item_id=>3}, ], "final results") or diag explain $res; }; subtest "partial success (success first)" => sub { my $envres = envresmulti; my $res; $envres->add_result(200, "OK", {item_id=>1}); $res = $envres->as_struct; is($res->[0], 200, "status 1"); is_deeply($res->[3]{results}, [ {status=>200, message=>"OK", item_id=>1}, ], "results 1") or diag explain $res; $envres->add_result(404, "Not found", {item_id=>2, note=>"blah"}); $res = $envres->as_struct; is($res->[0], 207, "final status"); is_deeply($res->[3]{results}, [ {status=>200, message=>"OK", item_id=>1}, {status=>404, message=>"Not found", item_id=>2, note=>"blah"}, ], "final results") or diag explain $res; }; subtest "partial success (fail first)" => sub { my $envres = envresmulti; my $res; $envres->add_result(500, "Failed", {item_id=>1}); $res = $envres->as_struct; is($res->[0], 500, "status 1"); is_deeply($res->[3]{results}, [ {status=>500, message=>"Failed", item_id=>1}, ], "results 1") or diag explain $res; $envres->add_result(200, "OK", {item_id=>2}); $res = $envres->as_struct; is($res->[0], 207, "final status"); is_deeply($res->[3]{results}, [ {status=>500, message=>"Failed", item_id=>1}, {status=>200, message=>"OK", item_id=>2}, ], "final results") or diag explain $res; }; subtest "all fail" => sub { my $envres = envresmulti; $envres->add_result(404, "Not found", {item_id=>1}); $envres->add_result(500, "Failed", {item_id=>2}); my $res = $envres->as_struct; is($res->[0], 500, "final status"); is_deeply($res->[3]{results}, [ {status=>404, message=>"Not found", item_id=>1}, {status=>500, message=>"Failed", item_id=>2}, ], "final results") or diag explain $res; }; done_testing; Perinci-Object-0.310/t/ResMeta.t0000644000175000017500000000031013362047057013733 0ustar s1s1#!perl use 5.010; use strict; use warnings; use Test::More 0.96; use Test::Exception; use Perinci::Object; my $riresmeta = riresmeta { }; is($riresmeta->type, "resmeta", "type"); done_testing(); Perinci-Object-0.310/t/Variable.t0000644000175000017500000000033513362047057014127 0ustar s1s1#!perl use 5.010; use strict; use warnings; use Test::More 0.98; use Test::Exception; use Perinci::Object; my $rivar = rivar { v=>1.1 }; is($rivar->type, "variable", "type"); is($rivar->v, 1.1, "v"); done_testing(); Perinci-Object-0.310/t/author-pod-syntax.t0000644000175000017500000000045413362047057016012 0ustar s1s1#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Perinci-Object-0.310/t/author-pod-coverage.t0000644000175000017500000000053613362047057016260 0ustar s1s1#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Perinci-Object-0.310/t/author-critic.t0000644000175000017500000000040313362047057015153 0ustar s1s1#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use strict; use warnings; use Test::Perl::Critic (-profile => "perlcritic.rc") x!! -e "perlcritic.rc"; all_critic_ok(); Perinci-Object-0.310/LICENSE0000644000175000017500000004407513362047057012770 0ustar s1s1This software is copyright (c) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. 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) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. 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, Fifth Floor, Boston, MA 02110-1301 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) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. 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 Perinci-Object-0.310/dist.ini0000644000175000017500000000056513362047057013423 0ustar s1s1version=0.310 name=Perinci-Object [@Author::PERLANCAR] :version=0.593 [Prereqs / TestRequires] Test::Exception=0 Test::More=0.98 [Prereqs] perl=5.010001 parent=0 strict=0 warnings=0 Exporter=5.57 [Prereqs / DevelopX_spec] -phase=develop -relationship=x_spec Rinci=1.1.83 [Prereqs / DevelopX_copypaste] -phase=develop -relationship=x_copypaste String::Trim::More=0.02