Build.PL100644001750001750 45515127232746 15624 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2# ========================================================================= # THIS FILE IS AUTOMATICALLY GENERATED BY MINILLA. # DO NOT EDIT DIRECTLY. # ========================================================================= use 5.008_001; use strict; use Module::Build::Tiny 0.035; Build_PL(); Changes100644001750001750 121415127232746 15635 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2Revision history for Perl extension MooX-Role-CloneSet v0.1.2 2026-01-06T16:18:44Z - Reformat the source code using `perltidy`. - Fix many minor nits suggested by `perlcritic`. - Add some `execline` tools to run `perltidy` and `perlcritic` via `tidyall`. - Relicense under version 2 of the Artistic license. - Switch to yearless copyright notices. - Switch to SPDX copyright and license tags. v0.1.1 2023-07-25T05:49:51Z - Add Perl 5.22, 5.24, and 5.26 to the Travis CI testing. - Fix a test module's package/Exporter structure bug exposed by Perl 5.39.1. v0.1.0 2016-09-13T08:36:48Z - Initial version. LICENSE100644001750001750 2107715127232746 15400 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2The Artistic License 2.0 Copyright (c) Peter Pentchev Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble This license establishes the terms under which a given free software Package may be copied, modified, distributed, and/or redistributed. The intent is that the Copyright Holder maintains some artistic control over the development of that Package while still keeping the Package available as open source and free software. You are always permitted to make arrangements wholly outside of this license directly with the Copyright Holder of a given Package. If the terms of this license do not permit the full use that you propose to make of the Package, you should contact the Copyright Holder and seek a different licensing arrangement. Definitions "Copyright Holder" means the individual(s) or organization(s) named in the copyright notice for the entire Package. "Contributor" means any party that has contributed code or other material to the Package, in accordance with the Copyright Holder's procedures. "You" and "your" means any person who would like to copy, distribute, or modify the Package. "Package" means the collection of files distributed by the Copyright Holder, and derivatives of that collection and/or of those files. A given Package may consist of either the Standard Version, or a Modified Version. "Distribute" means providing a copy of the Package or making it accessible to anyone else, or in the case of a company or organization, to others outside of your company or organization. "Distributor Fee" means any fee that you charge for Distributing this Package or providing support for this Package to another party. It does not mean licensing fees. "Standard Version" refers to the Package if it has not been modified, or has been modified only in ways explicitly requested by the Copyright Holder. "Modified Version" means the Package, if it has been changed, and such changes were not explicitly requested by the Copyright Holder. "Original License" means this Artistic License as Distributed with the Standard Version of the Package, in its current version or as it may be modified by The Perl Foundation in the future. "Source" form means the source code, documentation source, and configuration files for the Package. "Compiled" form means the compiled bytecode, object code, binary, or any other form resulting from mechanical transformation or translation of the Source form. Permission for Use and Modification Without Distribution (1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not Distribute the Modified Version. Permissions for Redistribution of the Standard Version (2) You may Distribute verbatim copies of the Source form of the Standard Version of this Package in any medium without restriction, either gratis or for a Distributor Fee, provided that you duplicate all of the original copyright notices and associated disclaimers. At your discretion, such verbatim copies may or may not include a Compiled form of the Package. (3) You may apply any bug fixes, portability changes, and other modifications made available from the Copyright Holder. The resulting Package will still be considered the Standard Version, and as such will be subject to the Original License. Distribution of Modified Versions of the Package as Source (4) You may Distribute your Modified Version as Source (either gratis or for a Distributor Fee, and with or without a Compiled form of the Modified Version) provided that you clearly document how it differs from the Standard Version, including, but not limited to, documenting any non-standard features, executables, or modules, and provided that you do at least ONE of the following: (a) make the Modified Version available to the Copyright Holder of the Standard Version, under the Original License, so that the Copyright Holder may include your modifications in the Standard Version. (b) ensure that installation of your Modified Version does not prevent the user installing or running the Standard Version. In addition, the Modified Version must bear a name that is different from the name of the Standard Version. (c) allow anyone who receives a copy of the Modified Version to make the Source form of the Modified Version available to others under (i) the Original License or (ii) a license that permits the licensee to freely copy, modify and redistribute the Modified Version using the same licensing terms that apply to the copy that the licensee received, and requires that the Source form of the Modified Version, and of any works derived from it, be made freely available in that license fees are prohibited but Distributor Fees are allowed. Distribution of Compiled Forms of the Standard Version or Modified Versions without the Source (5) You may Distribute Compiled forms of the Standard Version without the Source, provided that you include complete instructions on how to get the Source of the Standard Version. Such instructions must be valid at the time of your distribution. If these instructions, at any time while you are carrying out such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If you provide valid instructions or cease distribution within thirty days after you become aware that the instructions are invalid, then you do not forfeit any of your rights under this license. (6) You may Distribute a Modified Version in Compiled form without the Source, provided that you comply with Section 4 with respect to the Source of the Modified Version. Aggregating or Linking the Package (7) You may aggregate the Package (either the Standard Version or Modified Version) with other packages and Distribute the resulting aggregation provided that you do not charge a licensing fee for the Package. Distributor Fees are permitted, and licensing fees for other components in the aggregation are permitted. The terms of this license apply to the use and Distribution of the Standard or Modified Versions as included in the aggregation. (8) You are permitted to link Modified and Standard Versions with other works, to embed the Package in a larger work of your own, or to build stand-alone binary or bytecode versions of applications that include the Package, and Distribute the result without restriction, provided the result does not expose a direct interface to the Package. Items That are Not Considered Part of a Modified Version (9) Works (including, but not limited to, modules and scripts) that merely extend or make use of the Package, do not, by themselves, cause the Package to be a Modified Version. In addition, such works are not considered parts of the Package itself, and are not subject to the terms of this license. General Provisions (10) Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license. (11) If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license. (12) This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder. (13) This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed. (14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Artistic-2.0.txt100644001750001750 2107715127232746 20420 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/LICENSESThe Artistic License 2.0 Copyright (c) Peter Pentchev Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble This license establishes the terms under which a given free software Package may be copied, modified, distributed, and/or redistributed. The intent is that the Copyright Holder maintains some artistic control over the development of that Package while still keeping the Package available as open source and free software. You are always permitted to make arrangements wholly outside of this license directly with the Copyright Holder of a given Package. If the terms of this license do not permit the full use that you propose to make of the Package, you should contact the Copyright Holder and seek a different licensing arrangement. Definitions "Copyright Holder" means the individual(s) or organization(s) named in the copyright notice for the entire Package. "Contributor" means any party that has contributed code or other material to the Package, in accordance with the Copyright Holder's procedures. "You" and "your" means any person who would like to copy, distribute, or modify the Package. "Package" means the collection of files distributed by the Copyright Holder, and derivatives of that collection and/or of those files. A given Package may consist of either the Standard Version, or a Modified Version. "Distribute" means providing a copy of the Package or making it accessible to anyone else, or in the case of a company or organization, to others outside of your company or organization. "Distributor Fee" means any fee that you charge for Distributing this Package or providing support for this Package to another party. It does not mean licensing fees. "Standard Version" refers to the Package if it has not been modified, or has been modified only in ways explicitly requested by the Copyright Holder. "Modified Version" means the Package, if it has been changed, and such changes were not explicitly requested by the Copyright Holder. "Original License" means this Artistic License as Distributed with the Standard Version of the Package, in its current version or as it may be modified by The Perl Foundation in the future. "Source" form means the source code, documentation source, and configuration files for the Package. "Compiled" form means the compiled bytecode, object code, binary, or any other form resulting from mechanical transformation or translation of the Source form. Permission for Use and Modification Without Distribution (1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not Distribute the Modified Version. Permissions for Redistribution of the Standard Version (2) You may Distribute verbatim copies of the Source form of the Standard Version of this Package in any medium without restriction, either gratis or for a Distributor Fee, provided that you duplicate all of the original copyright notices and associated disclaimers. At your discretion, such verbatim copies may or may not include a Compiled form of the Package. (3) You may apply any bug fixes, portability changes, and other modifications made available from the Copyright Holder. The resulting Package will still be considered the Standard Version, and as such will be subject to the Original License. Distribution of Modified Versions of the Package as Source (4) You may Distribute your Modified Version as Source (either gratis or for a Distributor Fee, and with or without a Compiled form of the Modified Version) provided that you clearly document how it differs from the Standard Version, including, but not limited to, documenting any non-standard features, executables, or modules, and provided that you do at least ONE of the following: (a) make the Modified Version available to the Copyright Holder of the Standard Version, under the Original License, so that the Copyright Holder may include your modifications in the Standard Version. (b) ensure that installation of your Modified Version does not prevent the user installing or running the Standard Version. In addition, the Modified Version must bear a name that is different from the name of the Standard Version. (c) allow anyone who receives a copy of the Modified Version to make the Source form of the Modified Version available to others under (i) the Original License or (ii) a license that permits the licensee to freely copy, modify and redistribute the Modified Version using the same licensing terms that apply to the copy that the licensee received, and requires that the Source form of the Modified Version, and of any works derived from it, be made freely available in that license fees are prohibited but Distributor Fees are allowed. Distribution of Compiled Forms of the Standard Version or Modified Versions without the Source (5) You may Distribute Compiled forms of the Standard Version without the Source, provided that you include complete instructions on how to get the Source of the Standard Version. Such instructions must be valid at the time of your distribution. If these instructions, at any time while you are carrying out such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If you provide valid instructions or cease distribution within thirty days after you become aware that the instructions are invalid, then you do not forfeit any of your rights under this license. (6) You may Distribute a Modified Version in Compiled form without the Source, provided that you comply with Section 4 with respect to the Source of the Modified Version. Aggregating or Linking the Package (7) You may aggregate the Package (either the Standard Version or Modified Version) with other packages and Distribute the resulting aggregation provided that you do not charge a licensing fee for the Package. Distributor Fees are permitted, and licensing fees for other components in the aggregation are permitted. The terms of this license apply to the use and Distribution of the Standard or Modified Versions as included in the aggregation. (8) You are permitted to link Modified and Standard Versions with other works, to embed the Package in a larger work of your own, or to build stand-alone binary or bytecode versions of applications that include the Package, and Distribute the result without restriction, provided the result does not expose a direct interface to the Package. Items That are Not Considered Part of a Modified Version (9) Works (including, but not limited to, modules and scripts) that merely extend or make use of the Package, do not, by themselves, cause the Package to be a Modified Version. In addition, such works are not considered parts of the Package itself, and are not subject to the terms of this license. General Provisions (10) Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license. (11) If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license. (12) This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder. (13) This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed. (14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. META.json100644001750001750 412115127232746 15763 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2{ "abstract" : "create updated copies of immutable objects", "author" : [ "Peter Pentchev " ], "dynamic_config" : 0, "generated_by" : "Minilla/v3.1.29", "license" : [ "artistic_2" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "MooX-Role-CloneSet", "no_index" : { "directory" : [ "t", "xt", "inc", "share", "eg", "examples", "author", "builder", "tools", "LICENSES" ] }, "prereqs" : { "configure" : { "requires" : { "Module::Build::Tiny" : "0.035" } }, "develop" : { "requires" : { "Test::CPAN::Meta" : "0", "Test::MinimumVersion::Fast" : "0.04", "Test::PAUSE::Permissions" : "0.07", "Test::Pod" : "1.41", "Test::Spellunker" : "v0.2.7" } }, "runtime" : { "requires" : { "Moo" : "1.006", "namespace::clean" : "0.25", "perl" : "5.012" } }, "test" : { "requires" : { "Test::More" : "0.98" } } }, "provides" : { "MooX::Role::CloneSet" : { "file" : "lib/MooX/Role/CloneSet.pm", "version" : "v0.1.2" }, "MooX::Role::CloneSet::BuildArgs" : { "file" : "lib/MooX/Role/CloneSet/BuildArgs.pm", "version" : "v0.1.2" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/ppentchev/MooX-Role-CloneSet/issues" }, "homepage" : "https://github.com/ppentchev/MooX-Role-CloneSet", "repository" : { "type" : "git", "url" : "https://github.com/ppentchev/MooX-Role-CloneSet.git", "web" : "https://github.com/ppentchev/MooX-Role-CloneSet" } }, "version" : "v0.1.2", "x_authority" : "cpan:ROAM", "x_serialization_backend" : "JSON::PP version 4.16", "x_static_install" : 1 } README.md100644001750001750 262515127232746 15630 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2# NAME MooX::Role::CloneSet - create updated copies of immutable objects # SYNOPSIS package Someone; use Moo; with 'MooX::Role::CloneSet'; has name => ( is => 'ro', ); has race => ( is => 'ro', ); package main; my $first = Someone->new(name => 'Drizzt', race => 'drow'); my $hybrid = $first->cset(race => 'dwarf'); my $final = $weird->cset(name => 'Catti-brie', race => 'human'); # DESCRIPTION `MooX::Role::CloneSet` is a role for immutable objects, providing an easy way to create a new object with some modified properties. It provides the `cset()` method that creates a new object with the specified changes, shallowly copying all the rest of the original object's properties. # METHODS - cset(field => value, ...) Shallowly clone the object, making the specified changes to its attributes. Note that this method obtains the names and values of the current attributes by dereferencing the object as a hash reference; since Moo does not provide metaclasses by default, it cannot really get to them in any other way. This will not work for parameters that declare an `init_arg`; see `MooX::Role::CloneSet::BuildArgs` for an alternative if using truly immutable objects. # LICENSE SPDX-FileCopyrightText: Peter Pentchev SPDX-License-Identifier: Artistic-2.0 # AUTHOR Peter Pentchev REUSE.toml100644001750001750 75215127232746 16110 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2# SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 version = 1 SPDX-PackageName = "MooX-Role-CloneSet" SPDX-PackageSupplier = "Peter Pentchev " SPDX-PackageDownloadLocation = "https://github.com/ppentchev/MooX-Role-CloneSet" [[annotations]] path = [ "Build.PL", "Changes", "META.json", ] precedence = "aggregate" SPDX-FileCopyrightText = "Peter Pentchev " SPDX-License-Identifier = "Artistic-2.0" cpanfile100644001750001750 37015127232746 16030 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2# SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 requires 'perl', '5.012'; requires 'Moo', '1.006'; requires 'namespace::clean', '0.25'; on 'test' => sub { requires 'Test::More', '0.98'; }; CloneSet.pm100644001750001750 335415127232746 20754 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/lib/MooX/Rolepackage MooX::Role::CloneSet; use 5.012; use strict; use warnings; use Moo::Role; use namespace::clean; our $VERSION = v0.1.2; sub cset($ %) { my ( $self, %new ) = @_; # Hmm, so Moo doesn't have metaclasses, right? return $self->new( %{$self}, %new ); } 1; __END__ =encoding utf-8 =head1 NAME MooX::Role::CloneSet - create updated copies of immutable objects =head1 SYNOPSIS package Someone; use Moo; with 'MooX::Role::CloneSet'; has name => ( is => 'ro', ); has race => ( is => 'ro', ); package main; my $first = Someone->new(name => 'Drizzt', race => 'drow'); my $hybrid = $first->cset(race => 'dwarf'); my $final = $weird->cset(name => 'Catti-brie', race => 'human'); =head1 DESCRIPTION C is a role for immutable objects, providing an easy way to create a new object with some modified properties. It provides the C method that creates a new object with the specified changes, shallowly copying all the rest of the original object's properties. =head1 METHODS =over 4 =item * cset(field => value, ...) Shallowly clone the object, making the specified changes to its attributes. Note that this method obtains the names and values of the current attributes by dereferencing the object as a hash reference; since Moo does not provide metaclasses by default, it cannot really get to them in any other way. This will not work for parameters that declare an C; see C for an alternative if using truly immutable objects. =back =head1 LICENSE SPDX-FileCopyrightText: Peter Pentchev Eroam@ringlet.netE SPDX-License-Identifier: Artistic-2.0 =head1 AUTHOR Peter Pentchev Eroam@ringlet.netE =cut BuildArgs.pm100644001750001750 330015127232746 22617 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/lib/MooX/Role/CloneSetpackage MooX::Role::CloneSet::BuildArgs; use 5.012; use strict; use warnings; use Moo::Role; use namespace::clean; our $VERSION = v0.1.2; with 'MooX::BuildArgs'; sub cset($ %) { my ( $self, %new ) = @_; # Hmm, so Moo doesn't have metaclasses, right? return $self->new( %{ $self->build_args }, %new ); } 1; __END__ =encoding utf-8 =head1 NAME MooX::Role::CloneSet::BuildArgs - create updated copies of truly immutable objects =head1 SYNOPSIS package Someone; use Moo; with 'MooX::Role::CloneSet::BuildArgs'; has name => ( is => 'ro', ); has race => ( is => 'ro', ); package main; my $first = Someone->new(name => 'Drizzt', race => 'drow'); my $hybrid = $first->cset(race => 'dwarf'); my $final = $weird->cset(name => 'Catti-brie', race => 'human'); =head1 DESCRIPTION C is a role very similar to C; the only difference is that its C method does not try to obtain the current values of the object's attributes, but uses the ones the object was constructed with (using C). =head1 METHODS =over 4 =item * cset(field => value, ...) Shallowly clone the object, making the specified changes to its attributes. Note that this method obtains the names and values of the object's attributes by using the C method from C; thus, it really depends on the fact that none of the attributes has had its value changed since the object was constructed. =back =head1 LICENSE SPDX-FileCopyrightText: Peter Pentchev Eroam@ringlet.netE SPDX-License-Identifier: Artistic-2.0 =head1 AUTHOR Peter Pentchev Eroam@ringlet.netE =cut minil.toml100644001750001750 52715127232746 16335 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2# SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 name = "MooX-Role-CloneSet" authority = "cpan:ROAM" license = "artistic_2" module_maker="ModuleBuildTiny" [no_index] directory = [ "t", "xt", "inc", "share", "eg", "examples", "author", "builder", "tools", "LICENSES", ] 00_compile.t100644001750001750 111715127232746 16723 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/t#!/usr/bin/perl # SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 use 5.012; use strict; use warnings; use Test::More 0.98; our $VERSION = v0.1.0; my @modules = qw( MooX::Role::CloneSet ); my @buildargs_modules = qw( MooX::Role::CloneSet::BuildArgs ); plan tests => scalar @modules + scalar @buildargs_modules; for (@modules) { use_ok $_; } SKIP: { if ( !eval { require MooX::BuildArgs; 1; } ) { skip 'MooX::BuildArgs is not installed', scalar @buildargs_modules; } for (@buildargs_modules) { use_ok $_; } } 01_cloneset.t100644001750001750 173615127232746 17117 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/t#!/usr/bin/perl # SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 use 5.012; use strict; use warnings; use Scalar::Util qw(blessed); use lib 't/lib'; use Test::CloneSet qw(test_something); use Something; use Test::More 0.98; our $VERSION = v0.1.0; plan tests => 4; my $first = Something->new( name => 'giant panda', color => 'black & white' ); test_something 'The original panda', $first, 'giant panda', 'black & white'; my $intermediate = $first->cset( color => 'reddish-brown' ); test_something 'A weird animal with an identity crisis', $intermediate, 'giant panda', 'reddish-brown'; my $final = $intermediate->cset( name => 'red panda' ); test_something 'The cute and cuddly fox-like thing', $final, 'red panda', 'reddish-brown'; my $else = $intermediate->cset( name => 'mimic octopus', color => 'whatever you like' ); test_something 'And now for something completely different', $else, 'mimic octopus', 'whatever you like'; 02_buildargs.t100644001750001750 345515127232746 17260 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/t#!/usr/bin/perl # SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 use 5.012; use strict; use warnings; use English qw(-no_match_vars); use Scalar::Util qw(blessed); use lib 't/lib'; use Test::CloneSet qw(test_something); use Something::Mutable; use Test::More 0.98; our $VERSION = v0.1.0; plan tests => 2; subtest 'Plain CloneSet' => sub { plan tests => 3; my $panda = Something::Mutable->new( name => 'giant panda', color => 'black & white' ); test_something 'The original panda', $panda, 'giant panda', 'black & white'; # We are really not supposed to do this with immutable objects, # but it's necessary for demonstrating the difference between # the two CloneSet roles. $panda->name('another giant panda'); test_something 'Another panda', $panda, 'another giant panda', 'black & white'; my $another_panda = $panda->cset( color => 'see for yourself' ); test_something 'Yet another panda', $another_panda, 'another giant panda', 'see for yourself'; }; subtest 'CloneSet::BuildArgs' => sub { if ( !eval { require MooX::BuildArgs; 1; } ) { plan skip_all => 'MooX::BuildArgs not installed'; } require Something::Else; plan tests => 3; my $panda = Something::Else->new( name => 'giant panda', color => 'black & white' ); test_something 'The original panda', $panda, 'giant panda', 'black & white'; # We are really not supposed to do this with immutable objects, # but it's necessary for demonstrating the difference between # the two CloneSet roles. $panda->name('another giant panda'); test_something 'Another panda', $panda, 'another giant panda', 'black & white'; my $another_panda = $panda->cset( color => 'see for yourself' ); test_something 'Yet another panda', $another_panda, 'giant panda', 'see for yourself'; }; Something.pm100644001750001750 50515127232746 17630 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/t/lib#!/usr/bin/perl # SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 package Something; use 5.012; use strict; use warnings; use Moo; use namespace::clean; our $VERSION = v0.1.0; with 'MooX::Role::CloneSet'; has name => ( is => 'ro', ); has color => ( is => 'ro', ); 1; Else.pm100644001750001750 46715127232746 20527 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/t/lib/Something#!/usr/bin/perl # SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 package Something::Else; use 5.012; use strict; use warnings; use Moo; use namespace::clean; our $VERSION = v0.1.0; extends 'Something::Mutable'; with 'MooX::Role::CloneSet::BuildArgs'; 1; Mutable.pm100644001750001750 44715127232746 21226 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/t/lib/Something#!/usr/bin/perl # SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 package Something::Mutable; use 5.012; use strict; use warnings; use Moo; use namespace::clean; our $VERSION = v0.1.0; extends 'Something'; has name => ( is => 'rw', ); 1; CloneSet.pm100644001750001750 154215127232746 20350 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/t/lib/Test# SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 package Test::CloneSet; use 5.012; use strict; use warnings; use parent qw(Exporter); use Scalar::Util qw(blessed); our $VERSION = v0.1.2; our @EXPORT_OK = qw(&test_something); sub test_something($ $ $ $) { my ( $test, $thing, $name, $color ) = @_; Test::More::subtest( "$test" => sub { Test::More::plan( tests => 3 ); my $fine = defined($thing) && defined blessed($thing) && $thing->isa('Something'); Test::More::ok( $fine, 'we have something' ); SKIP: { if ( !$fine ) { Test::More::skip( 'cannot test the attributes of nothing', 2, ); } Test::More::is( $thing->name, $name, 'the right name' ); Test::More::is( $thing->color, $color, 'the right color' ); } }, ); return 1; } 1; el-format100755001750001750 73615127232746 17306 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/tools#!/usr/bin/env execlineb # SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 # TODO: handle -h / --help / -V / --version importas top_cmd 1 case -- $top_cmd { check { if { emptyenv -P tools/el-format-show-config } tidyall -a --check-only } reformat { if { emptyenv -P tools/el-format-show-config } tidyall -a --no-backups } } foreground { fdmove 1 2 echo "Usage: el-format check|reformat" } exit 1 el-format-show-config100755001750001750 32315127232746 21517 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/tools#!/usr/bin/env execlineb # SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 if { test -f .perltidyrc } if { test -f .tidyallrc } if { perltidy -dpro } exit 0 el-podman-build-unit-tests-container100755001750001750 73015127232746 24460 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/tools#!/usr/bin/env execlineb # SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 importas -S -D test-moox-role-cloneset TEST_CONTAINER_NAME importas -S -D stretch TEST_CONTAINER_LABEL backtick uid { id -u } backtick gid { id -g } importas -S uid importas -S gid podman build --build-arg "UID=${uid}" --build-arg "GID=${gid}" -t "${TEST_CONTAINER_NAME}:${TEST_CONTAINER_LABEL}" -- tools/podman/test-moox-role-cloneset/ el-podman-run-unit-tests100755001750001750 74615127232746 22214 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/tools#!/usr/bin/env execlineb # SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 importas -S -D test-moox-role-cloneset TEST_CONTAINER_NAME importas -S -D stretch TEST_CONTAINER_LABEL backtick uid { id -u } backtick gid { id -g } importas -S uid importas -S gid podman run --rm -it -v ".:/opt/src:rw" -w /opt/src -u "${uid}:${gid}" -- "${TEST_CONTAINER_NAME}:${TEST_CONTAINER_LABEL}" prove -I/home/jrl/perl5/lib/perl5 -l t el-run-tests100755001750001750 40215127232746 17750 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/tools#!/usr/bin/env execlineb # SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 if { minil test } if { emptyenv -P tools/el-podman-run-unit-tests } if { emptyenv -P tools/el-format check } echo "Seems fine" Containerfile100644001750001750 53715127232746 26164 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2/tools/podman/test-moox-role-cloneset# SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: Artistic-2.0 FROM perl:5.12.5-stretch ARG UID=1000 ARG GID=1000 ARG USERNAME=jrl RUN groupadd -g "${GID}" -- "${USERNAME}" RUN useradd -g "${GID}" -m -N -p '' -u "${UID}" -- "${USERNAME}" USER ${UID}:${GID} RUN cpanm Moo namespace::clean RUN cpanm Test::More META.yml100644001750001750 216715127232746 15623 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2--- abstract: 'create updated copies of immutable objects' author: - 'Peter Pentchev ' build_requires: Test::More: '0.98' configure_requires: Module::Build::Tiny: '0.035' dynamic_config: 0 generated_by: 'Minilla/v3.1.29, CPAN::Meta::Converter version 2.150010' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: MooX-Role-CloneSet no_index: directory: - t - xt - inc - share - eg - examples - author - builder - tools - LICENSES provides: MooX::Role::CloneSet: file: lib/MooX/Role/CloneSet.pm version: v0.1.2 MooX::Role::CloneSet::BuildArgs: file: lib/MooX/Role/CloneSet/BuildArgs.pm version: v0.1.2 requires: Moo: '1.006' namespace::clean: '0.25' perl: '5.012' resources: bugtracker: https://github.com/ppentchev/MooX-Role-CloneSet/issues homepage: https://github.com/ppentchev/MooX-Role-CloneSet repository: https://github.com/ppentchev/MooX-Role-CloneSet.git version: v0.1.2 x_authority: cpan:ROAM x_serialization_backend: 'CPAN::Meta::YAML version 0.018' x_static_install: 1 MANIFEST100644001750001750 77615127232746 15467 0ustar00roamroam000000000000MooX-Role-CloneSet-v0.1.2Build.PL Changes LICENSE LICENSES/Artistic-2.0.txt META.json README.md REUSE.toml cpanfile lib/MooX/Role/CloneSet.pm lib/MooX/Role/CloneSet/BuildArgs.pm minil.toml t/00_compile.t t/01_cloneset.t t/02_buildargs.t t/lib/Something.pm t/lib/Something/Else.pm t/lib/Something/Mutable.pm t/lib/Test/CloneSet.pm tools/el-format tools/el-format-show-config tools/el-podman-build-unit-tests-container tools/el-podman-run-unit-tests tools/el-run-tests tools/podman/test-moox-role-cloneset/Containerfile META.yml MANIFEST