Hello community, here is the log from the commit of package perl-boolean for openSUSE:Factory checked in at 2013-07-05 15:09:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-boolean (Old) and /work/SRC/openSUSE:Factory/.perl-boolean.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-boolean" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-boolean/perl-boolean.changes 2011-09-23 12:39:34.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-boolean.new/perl-boolean.changes 2013-07-05 15:09:09.000000000 +0200 @@ -1,0 +2,7 @@ +Wed Jul 3 08:36:19 UTC 2013 - [email protected] + +- updated to 0.30 + - Fix https://rt.cpan.org/Public/Bug/Display.html?id=84398 + - Support JSON and JSON::XS. dankogai-san++ + +------------------------------------------------------------------- Old: ---- boolean-0.28.tar.gz New: ---- boolean-0.30.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-boolean.spec ++++++ --- /var/tmp/diff_new_pack.8ktAtE/_old 2013-07-05 15:09:10.000000000 +0200 +++ /var/tmp/diff_new_pack.8ktAtE/_new 2013-07-05 15:09:10.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-boolean # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,20 +16,28 @@ # - Name: perl-boolean -Version: 0.28 -Release: 1 -License: GPL-1.0+ or Artistic-1.0 +Version: 0.30 +Release: 0 %define cpan_name boolean Summary: Boolean support for Perl -Url: http://search.cpan.org/dist/boolean/ +License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl +Url: http://search.cpan.org/dist/boolean/ Source: http://www.cpan.org/authors/id/I/IN/INGY/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros +#BuildRequires: perl(boolean) +#BuildRequires: perl(inc::Module::Package) +#BuildRequires: perl(JSON) +#BuildRequires: perl(LWP::Simple) +#BuildRequires: perl(Module::Build) +#BuildRequires: perl(Module::Install::Base) +#BuildRequires: perl(Parse::CPAN::Meta) +#BuildRequires: perl(Readonly) +#BuildRequires: perl(YAML::Tiny) Recommends: perl(Readonly) %{perl_requires} @@ -66,9 +74,6 @@ %perl_process_packlist %perl_gen_filelist -%clean -%{__rm} -rf %{buildroot} - %files -f %{name}.files %defattr(-,root,root,755) %doc Changes LICENSE README ++++++ boolean-0.28.tar.gz -> boolean-0.30.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/Changes new/boolean-0.30/Changes --- old/boolean-0.28/Changes 2011-09-12 13:51:52.000000000 +0200 +++ new/boolean-0.30/Changes 2013-04-04 00:24:55.000000000 +0200 @@ -1,4 +1,16 @@ --- +version: 0.30 +date: Wed Apr 3 15:24:44 PDT 2013 +changes: +- Fix https://rt.cpan.org/Public/Bug/Display.html?id=84398 +- chip++ +- Documented JSON support. +--- +version: 0.29 +date: Mon Apr 1 21:48:31 PDT 2013 +changes: +- Support JSON and JSON::XS. dankogai-san++ +--- version: 0.28 date: Mon Sep 12 13:51:47 CEST 2011 changes: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/LICENSE new/boolean-0.30/LICENSE --- old/boolean-0.28/LICENSE 2011-09-12 13:51:53.000000000 +0200 +++ new/boolean-0.30/LICENSE 2013-04-04 00:24:56.000000000 +0200 @@ -1,4 +1,4 @@ -This software is copyright (c) 2011 by Ingy döt Net <[email protected]>. +This software is copyright (c) 2013 by Ingy döt Net <[email protected]>. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -12,21 +12,22 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2011 by Ingy döt Net <[email protected]>. +This software is Copyright (c) 2013 by Ingy döt Net <[email protected]>. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 - GNU GENERAL PUBLIC LICENSE - Version 1, February 1989 + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA + Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public @@ -67,7 +68,7 @@ The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which @@ -185,7 +186,7 @@ of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + 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 @@ -207,9 +208,9 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - Appendix: How to Apply These Terms to Your New Programs + 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 @@ -235,8 +236,9 @@ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + 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. @@ -270,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2011 by Ingy döt Net <[email protected]>. +This software is Copyright (c) 2013 by Ingy döt Net <[email protected]>. This is free software, licensed under: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/MANIFEST new/boolean-0.30/MANIFEST --- old/boolean-0.28/MANIFEST 2011-09-12 13:51:53.000000000 +0200 +++ new/boolean-0.30/MANIFEST 2013-04-04 00:24:56.000000000 +0200 @@ -18,4 +18,5 @@ README t/boolean.t t/export.t +t/json.t t/truth.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/META.yml new/boolean-0.30/META.yml --- old/boolean-0.28/META.yml 2011-09-12 13:51:53.000000000 +0200 +++ new/boolean-0.30/META.yml 2013-04-04 00:24:56.000000000 +0200 @@ -3,11 +3,12 @@ author: - 'Ingy döt Net <[email protected]>' build_requires: - ExtUtils::MakeMaker: 6.42 + ExtUtils::MakeMaker: 6.36 configure_requires: - ExtUtils::MakeMaker: 6.42 + ExtUtils::MakeMaker: 6.36 distribution_type: module -generated_by: 'Module::Install version 1.01' +dynamic_config: 1 +generated_by: 'Module::Install version 1.06' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -23,7 +24,10 @@ requires: perl: 5.005003 resources: - homepage: http://github.com/ingydotnet/boolean-pm/tree + homepage: https://github.com/ingydotnet/boolean-pm/tree license: http://dev.perl.org/licenses/ - repository: git://github.com/ingydotnet/boolean-pm.git -version: 0.28 + repository: + type: git + url: git://github.com/ingydotnet/boolean-pm.git + web: https://github.com/ingydotnet/boolean-pm/tree +version: 0.30 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/Makefile.PL new/boolean-0.30/Makefile.PL --- old/boolean-0.28/Makefile.PL 2011-09-12 13:34:22.000000000 +0200 +++ new/boolean-0.30/Makefile.PL 2013-04-02 06:47:12.000000000 +0200 @@ -1,3 +1,3 @@ -use inc::Module::Package 'Ingy:modern 0.15'; +use inc::Module::Package 'Ingy:modern 0.20'; recommends 'Readonly'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/README new/boolean-0.30/README --- old/boolean-0.28/README 2011-09-12 13:51:53.000000000 +0200 +++ new/boolean-0.30/README 2013-04-04 00:24:55.000000000 +0200 @@ -117,11 +117,20 @@ "-truth" can be used with the other import options. +JSON SUPPORT + JSON.pm will encode Perl data with boolean.pm values correctly if you + use the "convert_blessed" option: + + use JSON; + use boolean -truth; + my $json = JSON->new->convert_blessed; + say $json->encode({false => (0 == 1)}); # Says: '{"false":false}', + AUTHOR Ingy döt Net <[email protected]> COPYRIGHT - Copyright (c) 2007, 2008, 2010, 2011. Ingy döt Net. + Copyright (c) 2007, 2008, 2010, 2011, 2013. Ingy döt Net. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/inc/Module/Install/Base.pm new/boolean-0.30/inc/Module/Install/Base.pm --- old/boolean-0.28/inc/Module/Install/Base.pm 2011-09-12 13:51:52.000000000 +0200 +++ new/boolean-0.30/inc/Module/Install/Base.pm 2013-04-04 00:24:55.000000000 +0200 @@ -4,7 +4,7 @@ use strict 'vars'; use vars qw{$VERSION}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.06'; } # Suspend handler for "redefined" warnings diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/inc/Module/Install/Can.pm new/boolean-0.30/inc/Module/Install/Can.pm --- old/boolean-0.28/inc/Module/Install/Can.pm 2011-09-12 13:51:53.000000000 +0200 +++ new/boolean-0.30/inc/Module/Install/Can.pm 2013-04-04 00:24:56.000000000 +0200 @@ -3,13 +3,12 @@ use strict; use Config (); -use File::Spec (); use ExtUtils::MakeMaker (); use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -29,7 +28,7 @@ eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } -# check if we can run some command +# Check if we can run some command sub can_run { my ($self, $cmd) = @_; @@ -38,14 +37,88 @@ for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { next if $dir eq ''; - my $abs = File::Spec->catfile($dir, $_[1]); + require File::Spec; + my $abs = File::Spec->catfile($dir, $cmd); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } -# can we locate a (the) C compiler +# Can our C compiler environment build XS files +sub can_xs { + my $self = shift; + + # Ensure we have the CBuilder module + $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 ); + + # Do we have the configure_requires checker? + local $@; + eval "require ExtUtils::CBuilder;"; + if ( $@ ) { + # They don't obey configure_requires, so it is + # someone old and delicate. Try to avoid hurting + # them by falling back to an older simpler test. + return $self->can_cc(); + } + + # Do we have a working C compiler + my $builder = ExtUtils::CBuilder->new( + quiet => 1, + ); + unless ( $builder->have_compiler ) { + # No working C compiler + return 0; + } + + # Write a C file representative of what XS becomes + require File::Temp; + my ( $FH, $tmpfile ) = File::Temp::tempfile( + "compilexs-XXXXX", + SUFFIX => '.c', + ); + binmode $FH; + print $FH <<'END_C'; +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +int main(int argc, char **argv) { + return 0; +} + +int boot_sanexs() { + return 1; +} + +END_C + close $FH; + + # Can the C compiler access the same headers XS does + my @libs = (); + my $object = undef; + eval { + local $^W = 0; + $object = $builder->compile( + source => $tmpfile, + ); + @libs = $builder->link( + objects => $object, + module_name => 'sanexs', + ); + }; + my $result = $@ ? 0 : 1; + + # Clean up all the build files + foreach ( $tmpfile, $object, @libs ) { + next unless defined $_; + 1 while unlink; + } + + return $result; +} + +# Can we locate a (the) C compiler sub can_cc { my $self = shift; my @chunks = split(/ /, $Config::Config{cc}) or return; @@ -78,4 +151,4 @@ __END__ -#line 156 +#line 236 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/inc/Module/Install/Fetch.pm new/boolean-0.30/inc/Module/Install/Fetch.pm --- old/boolean-0.28/inc/Module/Install/Fetch.pm 2011-09-12 13:51:53.000000000 +0200 +++ new/boolean-0.30/inc/Module/Install/Fetch.pm 2013-04-04 00:24:56.000000000 +0200 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/inc/Module/Install/GithubMeta.pm new/boolean-0.30/inc/Module/Install/GithubMeta.pm --- old/boolean-0.28/inc/Module/Install/GithubMeta.pm 2011-09-12 13:51:53.000000000 +0200 +++ new/boolean-0.30/inc/Module/Install/GithubMeta.pm 2013-04-04 00:24:56.000000000 +0200 @@ -7,20 +7,27 @@ use base qw(Module::Install::Base); use vars qw($VERSION); -$VERSION = '0.10'; +$VERSION = '0.16'; sub githubmeta { my $self = shift; return unless $Module::Install::AUTHOR; return unless _under_git(); return unless $self->can_run('git'); - return unless my ($git_url) = `git remote show -n origin` =~ /URL: (.*)$/m; + my $remote = shift || 'origin'; + return unless my ($git_url) = `git remote show -n $remote` =~ /URL: (.*)$/m; return unless $git_url =~ /github\.com/; # Not a Github repository my $http_url = $git_url; $git_url =~ s![\w\-]+\@([^:]+):!git://$1/!; - $http_url =~ s![\w\-]+\@([^:]+):!http://$1/!; + $http_url =~ s![\w\-]+\@([^:]+):!https://$1/!; $http_url =~ s!\.git$!/tree!; - $self->repository( $git_url ); + $self->repository( + { + type => 'git', + url => $git_url, + web => $http_url, + }, + ); $self->homepage( $http_url ) unless $self->homepage(); return 1; } @@ -47,4 +54,4 @@ 'Github'; __END__ -#line 108 +#line 117 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/inc/Module/Install/Makefile.pm new/boolean-0.30/inc/Module/Install/Makefile.pm --- old/boolean-0.28/inc/Module/Install/Makefile.pm 2011-09-12 13:51:53.000000000 +0200 +++ new/boolean-0.30/inc/Module/Install/Makefile.pm 2013-04-04 00:24:55.000000000 +0200 @@ -8,7 +8,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -215,18 +215,22 @@ require ExtUtils::MakeMaker; if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { - # MakeMaker can complain about module versions that include - # an underscore, even though its own version may contain one! - # Hence the funny regexp to get rid of it. See RT #35800 - # for details. - my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/; - $self->build_requires( 'ExtUtils::MakeMaker' => $v ); - $self->configure_requires( 'ExtUtils::MakeMaker' => $v ); + # This previous attempted to inherit the version of + # ExtUtils::MakeMaker in use by the module author, but this + # was found to be untenable as some authors build releases + # using future dev versions of EU:MM that nobody else has. + # Instead, #toolchain suggests we use 6.59 which is the most + # stable version on CPAN at time of writing and is, to quote + # ribasushi, "not terminally fucked, > and tested enough". + # TODO: We will now need to maintain this over time to push + # the version up as new versions are released. + $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 ); + $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 ); } else { # Allow legacy-compatibility with 5.005 by depending on the # most recent EU:MM that supported 5.005. - $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 ); - $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 ); + $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 ); + $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 ); } # Generate the MakeMaker params @@ -241,7 +245,6 @@ 'all_from' if you prefer) in Makefile.PL. EOT - $DB::single = 1; if ( $self->tests ) { my @tests = split ' ', $self->tests; my %seen; @@ -412,4 +415,4 @@ __END__ -#line 541 +#line 544 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/inc/Module/Install/Metadata.pm new/boolean-0.30/inc/Module/Install/Metadata.pm --- old/boolean-0.28/inc/Module/Install/Metadata.pm 2011-09-12 13:51:53.000000000 +0200 +++ new/boolean-0.30/inc/Module/Install/Metadata.pm 2013-04-04 00:24:55.000000000 +0200 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -151,15 +151,21 @@ sub install_as_vendor { $_[0]->installdirs('vendor') } sub dynamic_config { - my $self = shift; - unless ( @_ ) { - warn "You MUST provide an explicit true/false value to dynamic_config\n"; - return $self; + my $self = shift; + my $value = @_ ? shift : 1; + if ( $self->{values}->{dynamic_config} ) { + # Once dynamic we never change to static, for safety + return 0; } - $self->{values}->{dynamic_config} = $_[0] ? 1 : 0; + $self->{values}->{dynamic_config} = $value ? 1 : 0; return 1; } +# Convenience command +sub static_config { + shift->dynamic_config(0); +} + sub perl_version { my $self = shift; return $self->{values}->{perl_version} unless @_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/inc/Module/Install/Package.pm new/boolean-0.30/inc/Module/Install/Package.pm --- old/boolean-0.28/inc/Module/Install/Package.pm 2011-09-12 13:51:52.000000000 +0200 +++ new/boolean-0.30/inc/Module/Install/Package.pm 2013-04-04 00:24:55.000000000 +0200 @@ -16,7 +16,7 @@ use Module::Install::Base; use vars qw'@ISA $VERSION'; @ISA = 'Module::Install::Base'; -$VERSION = '0.28'; +$VERSION = '0.30'; #-----------------------------------------------------------------------------# # XXX BOOTBUGHACK @@ -54,6 +54,7 @@ # plugin directive: my $module_install_plugin; my $module_package_plugin; +my $module_package_dist_plugin; # XXX ARGVHACK This @argv thing is a temporary fix for an ugly bug somewhere in the # Wikitext module usage. my @argv; @@ -67,6 +68,10 @@ $module_package_plugin->mi($module_install_plugin); $module_package_plugin->version_check($VERSION); } + else { + $module_package_dist_plugin = $self->_load_dist_plugin($plugin_spec); + $module_package_dist_plugin->mi($module_install_plugin) if ref $module_package_dist_plugin; + } # NOTE - This is the point in time where the body of Makefile.PL runs... return; @@ -80,7 +85,9 @@ } else { $module_install_plugin->_initial(); + $module_package_dist_plugin->_initial() if ref $module_package_dist_plugin; $module_install_plugin->_main(); + $module_package_dist_plugin->_main() if ref $module_package_dist_plugin; } }; if ($@) { @@ -101,7 +108,10 @@ $module_package_plugin->final; $module_package_plugin->replicate_module_package; } - : $module_install_plugin->_final; + : do { + $module_install_plugin->_final; + $module_package_dist_plugin->_final() if ref $module_package_dist_plugin; + } } } @@ -123,8 +133,9 @@ # Find and load the author side plugin: sub _load_plugin { - my ($self, $spec) = @_; + my ($self, $spec, $namespace) = @_; $spec ||= ''; + $namespace ||= 'Module::Package'; my $version = ''; $Module::Package::plugin_version = 0; if ($spec =~ s/\s+(\S+)\s*//) { @@ -137,12 +148,22 @@ ($spec =~ /^:(\w+)$/) ? ('Plugin', "Plugin::$1") : ($spec =~ /^(\S*\w):(\w+)$/) ? ($1, "$1::$2") : die "$spec is invalid"; - $module = "Module::Package::$module"; - $plugin = "Module::Package::$plugin"; + $module = "${namespace}::${module}"; + $plugin = "${namespace}::${plugin}"; eval "use $module $version (); 1" or die $@; return $plugin->new(); } +# Find and load the user side plugin: +sub _load_dist_plugin { + my ($self, $spec, $namespace) = @_; + $spec ||= ''; + $namespace ||= 'Module::Package::Dist'; + my $r = eval { $self->_load_plugin($spec, $namespace); }; + return $r if ref $r; + return; +} + #-----------------------------------------------------------------------------# # These are the user side analogs to the author side plugin API calls. # Prefix with '_' to not pollute Module::Install plugin space. @@ -218,6 +239,32 @@ $self->WriteAll(@_); } +# Base package for Module::Package plugin distributed components. +package Module::Package::Dist; + +sub new { + my ($class, %args) = @_; + bless \%args, $class; +} + +sub mi { + @_ > 1 ? ($_[0]->{mi}=$_[1]) : $_[0]->{mi}; +} + +sub _initial { + my ($self) = @_; +} + +sub _main { + my ($self) = @_; +} + +sub _final { + my ($self) = @_; +} + +1; + #-----------------------------------------------------------------------------# # Take a guess at the primary .pm and .pod files for 'all_from', and friends. # Put them in global magical vars in the main:: namespace. @@ -265,7 +312,8 @@ package Module::Package::POD; use overload '""' => sub { return $_[0]->[0] if @{$_[0]}; - (my $pod = "$main::PM") =~ s/\.pm/.pod/ or die; + (my $pod = "$main::PM") =~ s/\.pm/.pod/ + or die "Module::Package's \$main::PM value should end in '.pm'"; return -e $pod ? $pod : ''; }; sub set { $_[0][0] = $_[1] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/inc/Module/Install/Win32.pm new/boolean-0.30/inc/Module/Install/Win32.pm --- old/boolean-0.28/inc/Module/Install/Win32.pm 2011-09-12 13:51:53.000000000 +0200 +++ new/boolean-0.30/inc/Module/Install/Win32.pm 2013-04-04 00:24:56.000000000 +0200 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/inc/Module/Install/WriteAll.pm new/boolean-0.30/inc/Module/Install/WriteAll.pm --- old/boolean-0.28/inc/Module/Install/WriteAll.pm 2011-09-12 13:51:53.000000000 +0200 +++ new/boolean-0.30/inc/Module/Install/WriteAll.pm 2013-04-04 00:24:56.000000000 +0200 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.06'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/inc/Module/Install.pm new/boolean-0.30/inc/Module/Install.pm --- old/boolean-0.28/inc/Module/Install.pm 2011-09-12 13:51:52.000000000 +0200 +++ new/boolean-0.30/inc/Module/Install.pm 2013-04-04 00:24:55.000000000 +0200 @@ -31,7 +31,7 @@ # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. - $VERSION = '1.01'; + $VERSION = '1.06'; # Storage for the pseudo-singleton $MAIN = undef; @@ -451,7 +451,7 @@ } sub _cmp ($$) { - _version($_[0]) <=> _version($_[1]); + _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS @@ -467,4 +467,4 @@ 1; -# Copyright 2008 - 2011 Adam Kennedy. +# Copyright 2008 - 2012 Adam Kennedy. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/inc/Module/Package.pm new/boolean-0.30/inc/Module/Package.pm --- old/boolean-0.28/inc/Module/Package.pm 2011-09-12 13:51:53.000000000 +0200 +++ new/boolean-0.30/inc/Module/Package.pm 2013-04-04 00:24:56.000000000 +0200 @@ -15,7 +15,7 @@ use strict; BEGIN { - $Module::Package::VERSION = '0.28'; + $Module::Package::VERSION = '0.30'; $inc::Module::Package::VERSION ||= $Module::Package::VERSION; @inc::Module::Package::ISA = __PACKAGE__; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/lib/boolean.pm new/boolean-0.30/lib/boolean.pm --- old/boolean-0.28/lib/boolean.pm 2011-09-12 13:49:24.000000000 +0200 +++ new/boolean-0.30/lib/boolean.pm 2013-04-04 00:23:36.000000000 +0200 @@ -1,8 +1,8 @@ use 5.005003; package boolean; -use strict; +use strict; use warnings; -$boolean::VERSION = '0.28'; +$boolean::VERSION = '0.30'; my ($true, $false); @@ -79,6 +79,8 @@ &Internals::SvREADONLY( \ !!1, 1); } +sub TO_JSON { ${$_[0]} ? \1 : \0 } + 1; =encoding utf8 @@ -228,13 +230,23 @@ C<-truth> can be used with the other import options. +=head1 JSON SUPPORT + +JSON.pm will encode Perl data with boolean.pm values correctly if you use the +C<convert_blessed> option: + + use JSON; + use boolean -truth; + my $json = JSON->new->convert_blessed; + say $json->encode({false => (0 == 1)}); # Says: '{"false":false}', + =head1 AUTHOR Ingy döt Net <[email protected]> =head1 COPYRIGHT -Copyright (c) 2007, 2008, 2010, 2011. Ingy döt Net. +Copyright (c) 2007, 2008, 2010, 2011, 2013. Ingy döt Net. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean-0.28/t/json.t new/boolean-0.30/t/json.t --- old/boolean-0.28/t/json.t 1970-01-01 01:00:00.000000000 +0100 +++ new/boolean-0.30/t/json.t 2013-04-03 23:54:42.000000000 +0200 @@ -0,0 +1,14 @@ +use strict; use warnings; +use Test::More tests => 2; +use boolean -truth; +my $HAVE_JSON = eval { require JSON }; +SKIP: { + skip "JSON is missing", 2 unless $HAVE_JSON; + eval{ + my $json = JSON->new->convert_blessed(); + is($json->encode({false => (0 == 1)}), '{"false":false}', + 'JSON false works'); + is($json->encode({true => (1 == 1)}), '{"true":true}', + 'JSON true works'); + } +}; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
