@@ -0,0 +1,3 @@
+use 5.008;
+use Module::Build::Tiny 0.021;
+Build_PL();
|
@@ -1,5 +1,10 @@
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 Makefile.PL
- % make && make test
+ % perl Build.PL
+ % ./Build && ./Build test
Then install it:
- % make install
+ % ./Build install
If you are installing into a system-wide directory, you may need to run:
- % sudo make install
+ % sudo ./Build install
## Documentation
|
@@ -1,15 +1,14 @@
+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.300021, CPAN::Meta::Converter version 2.120921",
+ "generated_by" : "Dist::Zilla version 4.300034, CPAN::Meta::Converter version 2.120921",
"license" : [
"perl_5"
],
@@ -16,7 +16,14 @@
"prereqs" : {
"configure" : {
"requires" : {
- "ExtUtils::MakeMaker" : "6.30"
+ "Module::Build::Tiny" : "0.021"
+ }
+ },
+ "develop" : {
+ "requires" : {
+ "Pod::Coverage::TrustPod" : "0",
+ "Test::Pod" : "1.41",
+ "Test::Pod::Coverage" : "1.08"
}
},
"runtime" : {
@@ -24,8 +31,7 @@
"Carp" : "0",
"Scalar::Util" : "0",
"Storable" : "0",
- "Sub::Exporter" : "0",
- "Sub::Exporter::Progressive" : "0",
+ "Sub::Exporter::Progressive" : "0.001007",
"perl" : "5.008",
"strict" : "0",
"warnings" : "0"
@@ -36,7 +42,7 @@
"Data::Dumper" : "0",
"File::Find" : "0",
"File::Temp" : "0",
- "Test::Exception" : "0.29",
+ "Test::Fatal" : "0",
"Test::More" : "0.88"
}
}
@@ -50,9 +56,9 @@
"repository" : {
"type" : "git",
}
},
- "version" : "0.013"
+ "version" : "0.014"
}
|
@@ -6,12 +6,12 @@ build_requires:
Data::Dumper: 0
File::Find: 0
File::Temp: 0
- Test::Exception: 0.29
+ Test::Fatal: 0
Test::More: 0.88
configure_requires:
- ExtUtils::MakeMaker: 6.30
+ Module::Build::Tiny: 0.021
dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.300021, CPAN::Meta::Converter version 2.120921'
+generated_by: 'Dist::Zilla version 4.300034, CPAN::Meta::Converter version 2.120921'
license: perl
meta-spec:
@@ -21,12 +21,11 @@ requires:
Carp: 0
Scalar::Util: 0
Storable: 0
- Sub::Exporter: 0
- Sub::Exporter::Progressive: 0
+ Sub::Exporter::Progressive: 0.001007
perl: 5.008
strict: 0
warnings: 0
resources:
-version: 0.013
+version: 0.014
|
@@ -1,63 +0,0 @@
-
-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.013:
+version 0.014:
Facility for creating read-only scalars, arrays, and hashes
|
@@ -4,6 +4,5 @@ license = Perl_5
copyright_holder = Leon Timmermans
copyright_year = 2010
-[@LEONT::PP]
-[Prereqs]
-Sub::Exporter = 0
+[@LEONT]
+install_tool = mbt
|
@@ -1,6 +1,6 @@
package Const::Fast;
{
- $Const::Fast::VERSION = '0.013';
+ $Const::Fast::VERSION = '0.014';
}
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 -setup => { exports => [qw/const/], groups => { default => [qw/const/] } };
+use Sub::Exporter::Progressive 0.001007 -setup => { exports => [qw/const/], groups => { default => [qw/const/] } };
sub _dclone($) {
require Storable;
@@ -21,11 +21,12 @@ 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])) {
- my $needs_cloning = !$dont_clone && &Internals::SvREFCNT($_[0]) > 1;
- $_[0] = _dclone($_[0]) if $needs_cloning;
+ $_[0] = _dclone($_[0]) if !$dont_clone && &Internals::SvREFCNT($_[0]) > 1 && !$skip{$reftype};
&Internals::SvREADONLY($_[0], 1);
if ($reftype eq 'SCALAR' || $reftype eq 'REF') {
_make_readonly(${ $_[0] }, 1);
@@ -70,8 +71,8 @@ sub const(\[$@%]@) {
# ABSTRACT: Facility for creating read-only scalars, arrays, and hashes
-
__END__
+
=pod
=head1 NAME
@@ -80,7 +81,7 @@ Const::Fast - Facility for creating read-only scalars, arrays, and hashes
=head1 VERSION
-version 0.013
+version 0.014
=head1 SYNOPSIS
@@ -100,7 +101,7 @@ version 0.013
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 for flexibility on import.
+Exporting is done using Sub::Exporter::Progressive. You may need to depend on Sub::Exporter explicitly if you need the latter's flexibility.
=head1 RATIONALE
@@ -132,4 +133,3 @@ 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,4 +70,5 @@ $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::Exception 0.29;
+use Test::Fatal qw(exception lives_ok);
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;
- return &throws_ok($sub, $error, $desc);
+ like(exception { $sub->() }, $error, $desc);
}
sub throws_reassign(&@) {
@@ -22,7 +22,13 @@ 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;
- return &throws_ok($sub, $error, $desc);
+ 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);
}
lives_ok { const my $scalar => 45 } 'Create scalar';
|
@@ -1,17 +0,0 @@
-#!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 $@;
|