@@ -0,0 +1,55 @@
+Contributing
+============
+
+The "boolean" Project needs your help!
+
+Please consider being a contributor. This file contains instructions that will
+help you be an effective contributor to the Project.
+
+GitHub
+------
+
+The code for this Project is hosted at GitHub. The repository is:
+
+ https://github.com/ingydotnet/boolean-pm
+
+You can get the code with this command:
+
+ git clone https://github.com/ingydotnet/boolean-pm
+
+If you've found a bug or a missing feature that you would like the author to
+know about, report it here:
+
+ https://github.com/ingydotnet/boolean-pm/issues
+
+or fix it and submit a pull request here:
+
+ https://github.com/ingydotnet/boolean-pm/pulls
+
+See these links for help on interacting with GitHub:
+
+* https://help.github.com/
+* https://help.github.com/articles/creating-a-pull-request
+
+Zilla::Dist
+-----------
+
+This Project uses Zilla::Dist to prepare it for publishing to CPAN. Read:
+
+ https://metacpan.org/pod/distribution/Zilla-Dist/lib/Zilla/Dist/Contributing.pod
+
+for up-to-date instructions on what contributors like yourself need to know to
+use it.
+
+IRC
+---
+
+boolean has an IRC channel where you can find real people to help you:
+
+ irc.freenode.net#pkg
+
+Join the channel. Join the team!
+
+
+ Thanks in advance, Ingy döt Net
+
@@ -1,3 +1,37 @@
+0.42 Sat Aug 16 10:49:31 PDT 2014
+ - Meta 0.0.2
+ - Remove .gitignore
+
+0.41 Fri Aug 15 15:41:09 PDT 2014
+ - Add t/000-compile-modules.t
+ - CPAN Day 2014 - 21 Release Salute!
+
+0.40 Fri Aug 8 19:12:51 PDT 2014
+ - Fix swim errors
+
+0.39 Sat Aug 2 10:17:12 PDT 2014
+ - Fix Copyright years.
+ - Fix Meta and add Contributing
+
+0.38 Wed Jun 25 21:08:05 PDT 2014
+ - Revert json.t. Failed on cpantesters.
+
+0.37 Wed Jun 25 16:47:29 PDT 2014
+ - Add JSON to recommends
+
+0.36 Wed Jun 25 16:46:39 PDT 2014
+ - Fix homepage in metadata
+
+0.35 Tue Jun 17 10:59:25 PDT 2014
+ - Remove ABSTRACT and use manual $VERSION
+
+0.34 Sat Jun 14 13:16:30 PDT 2014
+ - Release 0.33 got botched.
+
+0.33 Sat Jun 14 12:59:00 PDT 2014
+ - Package with Zilla::Dist
+ - Add badges
+
0.32 Sat Feb 8 19:17:09 PST 2014
- Some dzil changes
@@ -1,11 +1,14 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.012.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.019.
+CONTRIBUTING
Changes
LICENSE
MANIFEST
+META.json
META.yml
Makefile.PL
README
lib/boolean.pm
+lib/boolean.pod
t/boolean.t
t/export.t
t/json.t
@@ -0,0 +1,58 @@
+{
+ "abstract" : "Boolean support for Perl",
+ "author" : [
+ "Ingy döt Net <ingy@cpan.org>"
+ ],
+ "dynamic_config" : 0,
+ "generated_by" : "Dist::Zilla version 5.019, CPAN::Meta::Converter version 2.132830",
+ "license" : [
+ "perl_5"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : "2"
+ },
+ "name" : "boolean",
+ "no_index" : {
+ "directory" : [
+ "inc",
+ "t",
+ "xt",
+ "example"
+ ]
+ },
+ "prereqs" : {
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "6.30"
+ }
+ },
+ "develop" : {
+ "requires" : {
+ "Test::Pod" : "1.41"
+ }
+ },
+ "runtime" : {
+ "recommends" : {
+ "JSON" : "0"
+ },
+ "requires" : {
+ "perl" : "v5.8.1"
+ }
+ }
+ },
+ "release_status" : "stable",
+ "resources" : {
+ "bugtracker" : {
+ "web" : "https://github.com/ingydotnet/boolean-pm/issues"
+ },
+ "homepage" : "https://github.com/ingydotnet/boolean-pm",
+ "repository" : {
+ "type" : "git",
+ "url" : "https://github.com/ingydotnet/boolean-pm.git",
+ "web" : "https://github.com/ingydotnet/boolean-pm"
+ }
+ },
+ "version" : "0.42"
+}
+
@@ -6,18 +6,24 @@ build_requires: {}
configure_requires:
ExtUtils::MakeMaker: '6.30'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.012, CPAN::Meta::Converter version 2.132830'
+generated_by: 'Dist::Zilla version 5.019, CPAN::Meta::Converter version 2.132830'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: boolean
+no_index:
+ directory:
+ - inc
+ - t
+ - xt
+ - example
recommends:
- Readonly: '0'
+ JSON: '0'
requires:
perl: v5.8.1
resources:
bugtracker: https://github.com/ingydotnet/boolean-pm/issues
homepage: https://github.com/ingydotnet/boolean-pm
repository: https://github.com/ingydotnet/boolean-pm.git
-version: '0.32'
+version: '0.42'
@@ -1,5 +1,5 @@
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.012.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.019.
use strict;
use warnings;
@@ -12,7 +12,6 @@ use ExtUtils::MakeMaker 6.30;
my %WriteMakefileArgs = (
"ABSTRACT" => "Boolean support for Perl",
"AUTHOR" => "Ingy d\x{f6}t Net <ingy\@cpan.org>",
- "BUILD_REQUIRES" => {},
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => "6.30"
},
@@ -21,8 +20,7 @@ my %WriteMakefileArgs = (
"LICENSE" => "perl",
"NAME" => "boolean",
"PREREQ_PM" => {},
- "TEST_REQUIRES" => {},
- "VERSION" => "0.32",
+ "VERSION" => "0.42",
"test" => {
"TESTS" => "t/*.t"
}
@@ -50,38 +50,38 @@ RATIONALE
lacks native Boolean support.
Data interchange modules like YAML and JSON can now "use boolean" to
- encode/decode/roundtrip Boolean values.
+ encode*decode*roundtrip Boolean values.
FUNCTIONS
This module defines the following functions:
- true
+ "true"
This function returns a scalar value which will evaluate to true.
The value is a singleton object, meaning there is only one "true"
value in a Perl process at any time. You can check to see whether
the value is the "true" object with the isTrue function described
below.
- false
+ "false"
This function returns a scalar value which will evaluate to false.
The value is a singleton object, meaning there is only one "false"
value in a Perl process at any time. You can check to see whether
the value is the "false" object with the isFalse function described
below.
- boolean($scalar)
+ "boolean($scalar)"
Casts the scalar value to a boolean value. If $scalar is true, it
returns "boolean::true", otherwise it returns "boolean::false".
- isTrue($scalar)
+ "isTrue($scalar)"
Returns "boolean::true" if the scalar passed to it is the
"boolean::true" object. Returns "boolean::false" otherwise.
- isFalse($scalar)
+ "isFalse($scalar)"
Returns "boolean::true" if the scalar passed to it is the
"boolean::false" object. Returns "boolean::false" otherwise.
- isBoolean($scalar)
+ "isBoolean($scalar)"
Returns "boolean::true" if the scalar passed to it is the
"boolean::true" or "boolean::false" object. Returns "boolean::false"
otherwise.
@@ -89,10 +89,10 @@ FUNCTIONS
METHODS
Since true and false return objects, you can call methods on them.
- $boolean->isTrue
+ "$boolean->isTrue"
Same as isTrue($boolean).
- $boolean->isFalse
+ "$boolean->isFalse"
Same as isFalse($boolean).
USE OPTIONS
@@ -101,39 +101,39 @@ USE OPTIONS
The module also defines these export tags:
- :all
+ ":all"
Exports "true", "false", "boolean", "isTrue", "isFalse", "isBoolean"
- -truth
- You can specify the "-truth" option to override truth operators to
- return "boolean" values.
+ "-truth"
+ You can specify the "-truth" option to override truth operators to
+ return "boolean" values.
- use boolean -truth;
- print ref("hello" eq "world"), "\n";
+ use boolean -truth;
+ print ref("hello" eq "world"), "\n";
- Prints:
+ Prints:
- boolean
+ boolean
- "-truth" can be used with the other import options.
+ "-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:
+ JSON::MaybeXS (or less preferably JSON.pm ) will encode Perl data with
+ boolean.pm values correctly if you use the "convert_blessed" option:
- use JSON;
+ use JSON::MaybeXS;
use boolean -truth;
- my $json = JSON->new->convert_blessed;
+ my $json = JSON::MaybeXS->new->convert_blessed;
say $json->encode({false => (0 == 1)}); # Says: '{"false":false}',
AUTHOR
Ingy döt Net <ingy@cpan.org>
COPYRIGHT
- Copyright (c) 2007, 2008, 2010, 2011, 2013, 2014. Ingy döt Net.
+ Copyright 2007-2014. Ingy döt Net
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
- See http://www.perl.com/perl/misc/Artistic.html
+ See <http://www.perl.com/perl/misc/Artistic.html>
@@ -1,6 +1,6 @@
use strict; use warnings;
package boolean;
-our $VERSION = '0.32'; # VERSION
+our $VERSION = '0.42';
my ($true, $false);
@@ -80,175 +80,3 @@ sub truth {
sub TO_JSON { ${$_[0]} ? \1 : \0 }
1;
-
-=encoding utf8
-
-=head1 NAME
-
-boolean - Boolean support for Perl
-
-=head1 SYNOPSIS
-
- use boolean;
-
- do &always if true;
- do &never if false;
-
- do &maybe if boolean($value)->isTrue;
-
-and:
-
- use boolean ':all';
-
- $guess = int(rand(2)) % 2 ? true : false;
-
- do &something if isTrue($guess);
- do &something_else if isFalse($guess);
-
-and:
-
- use boolean -truth;
-
- die unless ref(42 == 42) eq 'boolean';
- die unless ("foo" =~ /bar/) eq '0';
-
-=head1 DESCRIPTION
-
-Most programming languages have a native C<Boolean> data type.
-Perl does not.
-
-Perl has a simple and well known Truth System. The following scalar
-values are false:
-
- $false1 = undef;
- $false2 = 0;
- $false3 = 0.0;
- $false4 = '';
- $false5 = '0';
-
-Every other scalar value is true.
-
-This module provides basic Boolean support, by defining two special
-objects: C<true> and C<false>.
-
-=head1 RATIONALE
-
-When sharing data between programming languages, it is important to
-support the same group of basic types. In Perlish programming languages,
-these types include: Hash, Array, String, Number, Null and Boolean. Perl
-lacks native Boolean support.
-
-Data interchange modules like YAML and JSON can now C<use boolean> to
-encode/decode/roundtrip Boolean values.
-
-=head1 FUNCTIONS
-
-This module defines the following functions:
-
-=over
-
-=item true
-
-This function returns a scalar value which will evaluate to true. The
-value is a singleton object, meaning there is only one "true" value in a
-Perl process at any time. You can check to see whether the value is the
-"true" object with the isTrue function described below.
-
-=item false
-
-This function returns a scalar value which will evaluate to false. The
-value is a singleton object, meaning there is only one "false" value in
-a Perl process at any time. You can check to see whether the value is
-the "false" object with the isFalse function described below.
-
-=item boolean($scalar)
-
-Casts the scalar value to a boolean value. If C<$scalar> is true, it
-returns C<boolean::true>, otherwise it returns C<boolean::false>.
-
-=item isTrue($scalar)
-
-Returns C<boolean::true> if the scalar passed to it is the
-C<boolean::true> object. Returns C<boolean::false> otherwise.
-
-=item isFalse($scalar)
-
-Returns C<boolean::true> if the scalar passed to it is the
-C<boolean::false> object. Returns C<boolean::false> otherwise.
-
-=item isBoolean($scalar)
-
-Returns C<boolean::true> if the scalar passed to it is the
-C<boolean::true> or C<boolean::false> object. Returns C<boolean::false>
-otherwise.
-
-=back
-
-=head1 METHODS
-
-Since true and false return objects, you can call methods on them.
-
-=over
-
-=item $boolean->isTrue
-
-Same as isTrue($boolean).
-
-=item $boolean->isFalse
-
-Same as isFalse($boolean).
-
-=back
-
-=head1 USE OPTIONS
-
-By default this module exports the C<true>, C<false> and C<boolean> functions.
-
-The module also defines these export tags:
-
-=over
-
-=item :all
-
-Exports C<true>, C<false>, C<boolean>, C<isTrue>, C<isFalse>, C<isBoolean>
-
-=back
-
-=head2 -truth
-
-You can specify the C<-truth> option to override truth operators to return
-C<boolean> values.
-
- use boolean -truth;
- print ref("hello" eq "world"), "\n";
-
-Prints:
-
- boolean
-
-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 <ingy@cpan.org>
-
-=head1 COPYRIGHT
-
-Copyright (c) 2007, 2008, 2010, 2011, 2013, 2014. Ingy döt Net.
-
-This program is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
-
-See http://www.perl.com/perl/misc/Artistic.html
-
-=cut
@@ -0,0 +1,179 @@
+=pod
+
+=for comment
+DO NOT EDIT. This Pod was generated by Swim.
+See http://github.com/ingydotnet/swim-pm#readme
+
+=encoding utf8
+
+=head1 NAME
+
+boolean - Boolean support for Perl
+
+=for html
+<a href="https://travis-ci.org/ingydotnet/boolean-pm"><img src="https://travis-ci.org/ingydotnet/boolean-pm.png" alt="boolean-pm"></a>
+<a href="https://coveralls.io/r/ingydotnet/boolean-pm?branch=master"><img src="https://coveralls.io/repos/ingydotnet/boolean-pm/badge.png" alt="boolean-pm"></a>
+
+=head1 SYNOPSIS
+
+ use boolean;
+
+ do &always if true;
+ do &never if false;
+
+ do &maybe if boolean($value)->isTrue;
+
+and:
+
+ use boolean ':all';
+
+ $guess = int(rand(2)) % 2 ? true : false;
+
+ do &something if isTrue($guess);
+ do &something_else if isFalse($guess);
+
+and:
+
+ use boolean -truth;
+
+ die unless ref(42 == 42) eq 'boolean';
+ die unless ("foo" =~ /bar/) eq '0';
+
+=head1 DESCRIPTION
+
+Most programming languages have a native C<Boolean> data type. Perl does not.
+
+Perl has a simple and well known Truth System. The following scalar values
+are false:
+
+ $false1 = undef;
+ $false2 = 0;
+ $false3 = 0.0;
+ $false4 = '';
+ $false5 = '0';
+
+Every other scalar value is true.
+
+This module provides basic Boolean support, by defining two special objects:
+C<true> and C<false>.
+
+=head1 RATIONALE
+
+When sharing data between programming languages, it is important to support
+the same group of basic types. In Perlish programming languages, these types
+include: Hash, Array, String, Number, Null and Boolean. Perl lacks native
+Boolean support.
+
+Data interchange modules like YAML and JSON can now C<use boolean> to
+encodeI<decode>roundtrip Boolean values.
+
+=head1 FUNCTIONS
+
+This module defines the following functions:
+
+=over
+
+=item C<true>
+
+This function returns a scalar value which will evaluate to true. The value is
+a singleton object, meaning there is only one "true" value in a Perl process
+at any time. You can check to see whether the value is the "true" object with
+the isTrue function described below.
+
+=item C<false>
+
+This function returns a scalar value which will evaluate to false. The value
+is a singleton object, meaning there is only one "false" value in a Perl
+process at any time. You can check to see whether the value is the "false"
+object with the isFalse function described below.
+
+=item C<boolean($scalar)>
+
+Casts the scalar value to a boolean value. If C<$scalar> is true, it returns
+C<boolean::true>, otherwise it returns C<boolean::false>.
+
+=item C<isTrue($scalar)>
+
+Returns C<boolean::true> if the scalar passed to it is the C<boolean::true>
+object. Returns C<boolean::false> otherwise.
+
+=item C<isFalse($scalar)>
+
+Returns C<boolean::true> if the scalar passed to it is the C<boolean::false>
+object. Returns C<boolean::false> otherwise.
+
+=item C<isBoolean($scalar)>
+
+Returns C<boolean::true> if the scalar passed to it is the C<boolean::true> or
+C<boolean::false> object. Returns C<boolean::false> otherwise.
+
+=back
+
+=head1 METHODS
+
+Since true and false return objects, you can call methods on them.
+
+=over
+
+=item C<< $boolean->isTrue >>
+
+Same as isTrue($boolean).
+
+=item C<< $boolean->isFalse >>
+
+Same as isFalse($boolean).
+
+=back
+
+=head1 USE OPTIONS
+
+By default this module exports the C<true>, C<false> and C<boolean> functions.
+
+The module also defines these export tags:
+
+=over
+
+=item C<:all>
+
+Exports C<true>, C<false>, C<boolean>, C<isTrue>, C<isFalse>, C<isBoolean>
+
+=item C<-truth>
+
+You can specify the C<-truth> option to override truth operators to return
+C<boolean> values.
+
+ use boolean -truth;
+ print ref("hello" eq "world"), "\n";
+
+Prints:
+
+ boolean
+
+C<-truth> can be used with the other import options.
+
+=back
+
+=head1 JSON SUPPORT
+
+JSON::MaybeXS (or less preferably JSON.pm ) will encode Perl data with
+boolean.pm values correctly if you use the C<convert_blessed> option:
+
+ use JSON::MaybeXS;
+ use boolean -truth;
+ my $json = JSON::MaybeXS->new->convert_blessed;
+ say $json->encode({false => (0 == 1)}); # Says: '{"false":false}',
+
+=head1 AUTHOR
+
+Ingy döt Net <ingy@cpan.org>
+
+=head1 COPYRIGHT
+
+Copyright 2007-2014. Ingy döt Net
+
+This program is free software; you can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+See L<http://www.perl.com/perl/misc/Artistic.html>
+
+=cut
@@ -1,11 +1,11 @@
use strict; use warnings;
use Test::More tests => 3;
use boolean -truth;
-my $HAVE_JSON = eval { require JSON };
+my $HAVE_JSON = eval { require JSON::MaybeXS };
SKIP: {
skip "JSON is missing", 3 unless $HAVE_JSON;
eval{
- my $json = JSON->new->convert_blessed();
+ my $json = JSON::MaybeXS->new->convert_blessed();
is($json->encode({false => (0 == 1)}), '{"false":false}',
'JSON false works');
is($json->encode({true => (1 == 1)}), '{"true":true}',
@@ -9,8 +9,6 @@ BEGIN {
# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
use Test::More;
-
-eval "use Test::Pod 1.41";
-plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
+use Test::Pod 1.41;
all_pod_files_ok();