From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

Build.PL 30
Changes 50
INSTALL 44
MANIFEST 12
META.json 137
META.yml 56
Makefile.PL 063
README 11
dist.ini 23
lib/Const/Fast.pm 88
t/00-compile.t 10
t/10-basics.t 93
t/release-kwalitee.t 017
13 files changed (This is a version diff) 52114
@@ -1,3 +0,0 @@
-use 5.008;
-use Module::Build::Tiny 0.021;
-Build_PL();
@@ -1,10 +1,5 @@
Revision history for Const-Fast
-0.014 2013-05-28 02:32:48 Europe/Amsterdam
- Pass coderefs and globrefs unchanged
- Conversion from Test::Exception to Test::Fatal (Karen Etheridge)
- Convert to Module::Build::Tiny
-
0.013 2012-09-07 23:50:25 Europe/Amsterdam
Lazy load Storable, it's usually not necessary
@@ -25,16 +25,16 @@ Alternatively, if your CPAN shell is set up, you should just be able to do:
As a last resort, you can manually install it. Download the tarball, untar it,
then build it:
- % perl Build.PL
- % ./Build && ./Build test
+ % perl Makefile.PL
+ % make && make test
Then install it:
- % ./Build install
+ % make install
If you are installing into a system-wide directory, you may need to run:
- % sudo ./Build install
+ % sudo make install
## Documentation
@@ -1,14 +1,15 @@
-Build.PL
Changes
INSTALL
LICENSE
MANIFEST
META.json
META.yml
+Makefile.PL
README
dist.ini
lib/Const/Fast.pm
t/00-compile.t
t/10-basics.t
+t/release-kwalitee.t
t/release-pod-coverage.t
t/release-pod-syntax.t
@@ -4,7 +4,7 @@
"Leon Timmermans <fawaka@gmail.com>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 4.300034, CPAN::Meta::Converter version 2.120921",
+ "generated_by" : "Dist::Zilla version 4.300021, CPAN::Meta::Converter version 2.120921",
"license" : [
"perl_5"
],
@@ -16,14 +16,7 @@
"prereqs" : {
"configure" : {
"requires" : {
- "Module::Build::Tiny" : "0.021"
- }
- },
- "develop" : {
- "requires" : {
- "Pod::Coverage::TrustPod" : "0",
- "Test::Pod" : "1.41",
- "Test::Pod::Coverage" : "1.08"
+ "ExtUtils::MakeMaker" : "6.30"
}
},
"runtime" : {
@@ -31,7 +24,8 @@
"Carp" : "0",
"Scalar::Util" : "0",
"Storable" : "0",
- "Sub::Exporter::Progressive" : "0.001007",
+ "Sub::Exporter" : "0",
+ "Sub::Exporter::Progressive" : "0",
"perl" : "5.008",
"strict" : "0",
"warnings" : "0"
@@ -42,7 +36,7 @@
"Data::Dumper" : "0",
"File::Find" : "0",
"File::Temp" : "0",
- "Test::Fatal" : "0",
+ "Test::Exception" : "0.29",
"Test::More" : "0.88"
}
}
@@ -56,9 +50,9 @@
"repository" : {
"type" : "git",
}
},
- "version" : "0.014"
+ "version" : "0.013"
}
@@ -6,12 +6,12 @@ build_requires:
Data::Dumper: 0
File::Find: 0
File::Temp: 0
- Test::Fatal: 0
+ Test::Exception: 0.29
Test::More: 0.88
configure_requires:
- Module::Build::Tiny: 0.021
+ ExtUtils::MakeMaker: 6.30
dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.300034, CPAN::Meta::Converter version 2.120921'
+generated_by: 'Dist::Zilla version 4.300021, CPAN::Meta::Converter version 2.120921'
license: perl
meta-spec:
@@ -21,11 +21,12 @@ requires:
Carp: 0
Scalar::Util: 0
Storable: 0
- Sub::Exporter::Progressive: 0.001007
+ Sub::Exporter: 0
+ Sub::Exporter::Progressive: 0
perl: 5.008
strict: 0
warnings: 0
resources:
-version: 0.014
+version: 0.013
@@ -0,0 +1,63 @@
+
+use strict;
+use warnings;
+
+use 5.008;
+
+use ExtUtils::MakeMaker 6.30;
+
+
+
+my %WriteMakefileArgs = (
+ "ABSTRACT" => "Facility for creating read-only scalars, arrays, and hashes",
+ "AUTHOR" => "Leon Timmermans <fawaka\@gmail.com>",
+ "BUILD_REQUIRES" => {
+ "Data::Dumper" => 0,
+ "File::Find" => 0,
+ "File::Temp" => 0,
+ "Test::Exception" => "0.29",
+ "Test::More" => "0.88"
+ },
+ "CONFIGURE_REQUIRES" => {
+ "ExtUtils::MakeMaker" => "6.30"
+ },
+ "DISTNAME" => "Const-Fast",
+ "EXE_FILES" => [],
+ "LICENSE" => "perl",
+ "NAME" => "Const::Fast",
+ "PREREQ_PM" => {
+ "Carp" => 0,
+ "Scalar::Util" => 0,
+ "Storable" => 0,
+ "Sub::Exporter" => 0,
+ "Sub::Exporter::Progressive" => 0,
+ "strict" => 0,
+ "warnings" => 0
+ },
+ "VERSION" => "0.013",
+ "test" => {
+ "TESTS" => "t/*.t"
+ }
+);
+
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
+ my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
+ my $pp = $WriteMakefileArgs{PREREQ_PM};
+ for my $mod ( keys %$br ) {
+ if ( exists $pp->{$mod} ) {
+ $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
+ }
+ else {
+ $pp->{$mod} = $br->{$mod};
+ }
+ }
+}
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+ unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
+
+WriteMakefile(%WriteMakefileArgs);
+
+
+
@@ -1,7 +1,7 @@
This archive contains the distribution Const-Fast,
-version 0.014:
+version 0.013:
Facility for creating read-only scalars, arrays, and hashes
@@ -4,5 +4,6 @@ license = Perl_5
copyright_holder = Leon Timmermans
copyright_year = 2010
-[@LEONT]
-install_tool = mbt
+[@LEONT::PP]
+[Prereqs]
+Sub::Exporter = 0
@@ -1,6 +1,6 @@
package Const::Fast;
{
- $Const::Fast::VERSION = '0.014';
+ $Const::Fast::VERSION = '0.013';
}
use 5.008;
@@ -9,7 +9,7 @@ use warnings FATAL => 'all';
use Scalar::Util qw/reftype blessed/;
use Carp qw/croak/;
-use Sub::Exporter::Progressive 0.001007 -setup => { exports => [qw/const/], groups => { default => [qw/const/] } };
+use Sub::Exporter::Progressive -setup => { exports => [qw/const/], groups => { default => [qw/const/] } };
sub _dclone($) {
require Storable;
@@ -21,12 +21,11 @@ sub _dclone($) {
## no critic (RequireArgUnpacking, ProhibitAmpersandSigils)
# The use of $_[0] is deliberate and essential, to be able to use it as an lvalue and to keep the refcount down.
-my %skip = map { $_ => 1 } qw/CODE GLOB/;
-
sub _make_readonly {
my (undef, $dont_clone) = @_;
if (my $reftype = reftype $_[0] and not blessed($_[0]) and not &Internals::SvREADONLY($_[0])) {
- $_[0] = _dclone($_[0]) if !$dont_clone && &Internals::SvREFCNT($_[0]) > 1 && !$skip{$reftype};
+ my $needs_cloning = !$dont_clone && &Internals::SvREFCNT($_[0]) > 1;
+ $_[0] = _dclone($_[0]) if $needs_cloning;
&Internals::SvREADONLY($_[0], 1);
if ($reftype eq 'SCALAR' || $reftype eq 'REF') {
_make_readonly(${ $_[0] }, 1);
@@ -71,8 +70,8 @@ sub const(\[$@%]@) {
# ABSTRACT: Facility for creating read-only scalars, arrays, and hashes
-__END__
+__END__
=pod
=head1 NAME
@@ -81,7 +80,7 @@ Const::Fast - Facility for creating read-only scalars, arrays, and hashes
=head1 VERSION
-version 0.014
+version 0.013
=head1 SYNOPSIS
@@ -101,7 +100,7 @@ version 0.014
This the only function of this module and it is exported by default. It takes a scalar, array or hash lvalue as first argument, and a list of one or more values depending on the type of the first argument as the value for the variable. It will set the variable to that value and subsequently make it readonly. Arrays and hashes will be made deeply readonly.
-Exporting is done using Sub::Exporter::Progressive. You may need to depend on Sub::Exporter explicitly if you need the latter's flexibility.
+Exporting is done using Sub::Exporter for flexibility on import.
=head1 RATIONALE
@@ -133,3 +132,4 @@ 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
+
@@ -70,5 +70,4 @@ $plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");
script_compiles( $file, "$script script compiles" );
}
}
-
}
@@ -5,7 +5,7 @@
use strict;
use warnings FATAL => 'all';
use Test::More 0.88;
-use Test::Fatal qw(exception lives_ok);
+use Test::Exception 0.29;
use Const::Fast;
@@ -14,7 +14,7 @@ sub throws_readonly(&@) {
my ($file, $line) = (caller)[1,2];
my $error = qr/\AModification of a read-only value attempted at \Q$file\E line $line\.\Z/;
local $Test::Builder::Level = $Test::Builder::Level + 1;
- like(exception { $sub->() }, $error, $desc);
+ return &throws_ok($sub, $error, $desc);
}
sub throws_reassign(&@) {
@@ -22,13 +22,7 @@ sub throws_reassign(&@) {
my ($file, $line) = (caller)[1,2];
my $error = qr/\AAttempt to reassign a readonly \w+ at \Q$file\E line $line\.?\Z/;
local $Test::Builder::Level = $Test::Builder::Level + 1;
- like(exception { $sub->() }, $error, $desc);
-}
-
-sub throws_ok(&@) {
- my ($sub, $error, $desc) = @_;
- local $Test::Builder::Level = $Test::Builder::Level + 1;
- like(exception { $sub->() }, $error, $desc);
+ return &throws_ok($sub, $error, $desc);
}
lives_ok { const my $scalar => 45 } 'Create scalar';
@@ -0,0 +1,17 @@
+#!perl
+
+BEGIN {
+ unless ($ENV{RELEASE_TESTING}) {
+ require Test::More;
+ Test::More::plan(skip_all => 'these tests are for release candidate testing');
+ }
+}
+
+
+# This test is generated by Dist::Zilla::Plugin::Test::Kwalitee
+use strict;
+use warnings;
+use Test::More; # needed to provide plan.
+eval "use Test::Kwalitee";
+
+plan skip_all => "Test::Kwalitee required for testing kwalitee" if $@;