The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Changes 03
MANIFEST 01
META.json 67
META.yml 78
README.md 2222
lib/Mouse/Exporter.pm 11
lib/Mouse/Meta/Attribute.pm 11
lib/Mouse/Meta/Class.pm 11
lib/Mouse/Meta/Method/Accessor.pm 11
lib/Mouse/Meta/Method/Constructor.pm 11
lib/Mouse/Meta/Method/Delegation.pm 11
lib/Mouse/Meta/Method/Destructor.pm 11
lib/Mouse/Meta/Method.pm 11
lib/Mouse/Meta/Module.pm 11
lib/Mouse/Meta/Role/Application.pm 11
lib/Mouse/Meta/Role/Composite.pm 11
lib/Mouse/Meta/Role/Method.pm 11
lib/Mouse/Meta/Role.pm 11
lib/Mouse/Meta/TypeConstraint.pm 11
lib/Mouse/Object.pm 11
lib/Mouse/PurePerl.pm 11
lib/Mouse/Role.pm 22
lib/Mouse/Spec.pm 22
lib/Mouse/Util/TypeConstraints.pm 11
lib/Mouse/Util.pm 22
lib/Mouse.pm 22
t/101_issues/016_Bool.t 044
xs-src/MouseTypeConstraints.xs 17
28 files changed (This is a version diff) 61117
@@ -1,5 +1,8 @@
 Revision history for Mouse
 
+2.2.0 2014-04-03T22:34:42Z
+    - Fixed #16 - inconsistent coercion/validation of Bool type (tokuhirom)
+
 2.1.1 2014-03-26T13:23:48Z
     - Fixed #18 (tokuhirom)
 
@@ -293,6 +293,7 @@ t/100_bugs/026_create_anon_recursion.t
 t/100_bugs/027_constructor_object_overload.t
 t/100_bugs/029_instance_application_role_args.t
 t/100_bugs/030_coerce_without_coercion.t
+t/101_issues/016_Bool.t
 t/200_examples/001_example.t
 t/200_examples/003_example.t
 t/200_examples/004_example_w_DCS.t
@@ -78,7 +78,7 @@
    "provides" : {
       "Mouse" : {
          "file" : "lib/Mouse.pm",
-         "version" : "v2.1.1"
+         "version" : "v2.2.0"
       },
       "Mouse::Exporter" : {
          "file" : "lib/Mouse/Exporter.pm"
@@ -133,11 +133,11 @@
       },
       "Mouse::Role" : {
          "file" : "lib/Mouse/Role.pm",
-         "version" : "v2.1.1"
+         "version" : "v2.2.0"
       },
       "Mouse::Spec" : {
          "file" : "lib/Mouse/Spec.pm",
-         "version" : "v2.1.1"
+         "version" : "v2.2.0"
       },
       "Mouse::Tiny" : {
          "file" : "lib/Mouse/Tiny.pm",
@@ -148,7 +148,7 @@
       },
       "Mouse::Util" : {
          "file" : "lib/Mouse/Util.pm",
-         "version" : "v2.1.1"
+         "version" : "v2.2.0"
       },
       "Mouse::Util::MetaRole" : {
          "file" : "lib/Mouse/Util/MetaRole.pm"
@@ -180,7 +180,7 @@
          "web" : "https://github.com/gfx/p5-Mouse"
       }
    },
-   "version" : "2.1.1",
+   "version" : "2.2.0",
    "x_contributors" : [
       "Ricardo SIGNES <rjbs@cpan.org>",
       "大沢 和宏 <yappo@shibuya.pl>",
@@ -215,8 +215,9 @@
       "David Steinbrunner <dsteinbrunner@pobox.com>",
       "Masahiro Honma <hiratara@cpan.org>",
       "Fuji, Goro <goro-fuji@cookpad.com>",
-      "Tokuhiro Matsuno <tokuhirom@gmail.com>",
       "Syohei YOSHIDA <syohex@gmail.com>",
+      "Sergiy Zuban <s.zuban@trackingsoft.com>",
+      "Tokuhiro Matsuno <tokuhirom@gmail.com>",
       "Fuji, Goro <gfuji@cpan.org>"
    ]
 }
@@ -19,7 +19,7 @@ configure_requires:
   Module::Build: 0.4005
   Module::Build::XSUtil: 0
 dynamic_config: 0
-generated_by: 'Minilla/v0.13.0, CPAN::Meta::Converter version 2.130880'
+generated_by: 'Minilla/v0.13.0, CPAN::Meta::Converter version 2.133380'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -37,7 +37,7 @@ no_index:
 provides:
   Mouse:
     file: lib/Mouse.pm
-    version: v2.1.1
+    version: v2.2.0
   Mouse::Exporter:
     file: lib/Mouse/Exporter.pm
   Mouse::Meta::Attribute:
@@ -74,10 +74,10 @@ provides:
     file: lib/Mouse/PurePerl.pm
   Mouse::Role:
     file: lib/Mouse/Role.pm
-    version: v2.1.1
+    version: v2.2.0
   Mouse::Spec:
     file: lib/Mouse/Spec.pm
-    version: v2.1.1
+    version: v2.2.0
   Mouse::Tiny:
     file: lib/Mouse/Tiny.pm
     version: v2.1.0
@@ -85,7 +85,7 @@ provides:
     file: lib/Mouse/TypeRegistry.pm
   Mouse::Util:
     file: lib/Mouse/Util.pm
-    version: v2.1.1
+    version: v2.2.0
   Mouse::Util::MetaRole:
     file: lib/Mouse/Util/MetaRole.pm
   Mouse::Util::TypeConstraints:
@@ -106,7 +106,7 @@ resources:
   bugtracker: https://github.com/gfx/p5-Mouse/issues
   homepage: https://github.com/gfx/p5-Mouse
   repository: git://github.com/gfx/p5-Mouse.git
-version: 2.1.1
+version: 2.2.0
 x_contributors:
   - 'Ricardo SIGNES <rjbs@cpan.org>'
   - '大沢 和宏 <yappo@shibuya.pl>'
@@ -141,6 +141,7 @@ x_contributors:
   - 'David Steinbrunner <dsteinbrunner@pobox.com>'
   - 'Masahiro Honma <hiratara@cpan.org>'
   - 'Fuji, Goro <goro-fuji@cookpad.com>'
-  - 'Tokuhiro Matsuno <tokuhirom@gmail.com>'
   - 'Syohei YOSHIDA <syohex@gmail.com>'
+  - 'Sergiy Zuban <s.zuban@trackingsoft.com>'
+  - 'Tokuhiro Matsuno <tokuhirom@gmail.com>'
   - 'Fuji, Goro <gfuji@cpan.org>'
@@ -5,7 +5,7 @@ Mouse - Moose minus the antlers
 
 # VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 # SYNOPSIS
 
@@ -41,7 +41,7 @@ This document describes Mouse version 2.1.1
 
 # DESCRIPTION
 
-[Moose](http://search.cpan.org/perldoc?Moose) is a postmodern object system for Perl5. Moose is wonderful.
+[Moose](https://metacpan.org/pod/Moose) is a postmodern object system for Perl5. Moose is wonderful.
 
 Unfortunately, Moose has a compile-time penalty. Though significant progress
 has been made over the years, the compile time penalty is a non-starter for
@@ -65,7 +65,7 @@ The Mouse code just runs its test suite 4x faster.
 
 The idea is that, if you need the extra power, you should be able to run
 `s/Mouse/Moose/g` on your codebase and have nothing break. To that end,
-we have written [Any::Moose](http://search.cpan.org/perldoc?Any::Moose) which will act as Mouse unless Moose is loaded,
+we have written [Any::Moose](https://metacpan.org/pod/Any::Moose) which will act as Mouse unless Moose is loaded,
 in which case it will act as Moose. Since Mouse is a little sloppier than
 Moose, if you run into weird errors, it would be worth running:
 
@@ -74,7 +74,7 @@ Moose, if you run into weird errors, it would be worth running:
 to see if the bug is caused by Mouse. Moose's diagnostics and validation are
 also better.
 
-See also [Mouse::Spec](http://search.cpan.org/perldoc?Mouse::Spec) for compatibility and incompatibility with Moose.
+See also [Mouse::Spec](https://metacpan.org/pod/Mouse::Spec) for compatibility and incompatibility with Moose.
 
 ## Mouse Extentions
 
@@ -96,15 +96,15 @@ Sets this class' superclasses.
 
 ## `before (method|methods|regexp) => CodeRef`
 
-Installs a "before" method modifier. See ["before" in Moose](http://search.cpan.org/perldoc?Moose#before).
+Installs a "before" method modifier. See ["before" in Moose](https://metacpan.org/pod/Moose#before).
 
 ## `after (method|methods|regexp) => CodeRef`
 
-Installs an "after" method modifier. See ["after" in Moose](http://search.cpan.org/perldoc?Moose#after).
+Installs an "after" method modifier. See ["after" in Moose](https://metacpan.org/pod/Moose#after).
 
 ## `around (method|methods|regexp) => CodeRef`
 
-Installs an "around" method modifier. See ["around" in Moose](http://search.cpan.org/perldoc?Moose#around).
+Installs an "around" method modifier. See ["around" in Moose](https://metacpan.org/pod/Moose#around).
 
 ## `has (name|names) => parameters`
 
@@ -126,13 +126,13 @@ this class. Options:
 
     Provides type checking in the constructor and accessor. The following types are
     supported. Any unknown type is taken to be a class check
-    (e.g. `isa => 'DateTime'` would accept only [DateTime](http://search.cpan.org/perldoc?DateTime) objects).
+    (e.g. `isa => 'DateTime'` would accept only [DateTime](https://metacpan.org/pod/DateTime) objects).
 
         Any Item Bool Undef Defined Value Num Int Str ClassName
         Ref ScalarRef ArrayRef HashRef CodeRef RegexpRef GlobRef
         FileHandle Object
 
-    For more documentation on type constraints, see [Mouse::Util::TypeConstraints](http://search.cpan.org/perldoc?Mouse::Util::TypeConstraints).
+    For more documentation on type constraints, see [Mouse::Util::TypeConstraints](https://metacpan.org/pod/Mouse::Util::TypeConstraints).
 
 - `does => RoleName`
 
@@ -143,7 +143,7 @@ this class. Options:
 
     This will attempt to use coercion with the supplied type constraint to change
     the value passed into any accessors or constructors. You __must__ have supplied
-    a type constraint in order for this to work. See [Moose::Cookbook::Basics::Recipe5](http://search.cpan.org/perldoc?Moose::Cookbook::Basics::Recipe5)
+    a type constraint in order for this to work. See [Moose::Cookbook::Basics::Recipe5](https://metacpan.org/pod/Moose::Cookbook::Basics::Recipe5)
     for an example.
 
 - `required => Bool`
@@ -192,7 +192,7 @@ this class. Options:
 
     Lets you automatically weaken any reference stored in the attribute.
 
-    Use of this feature requires [Scalar::Util](http://search.cpan.org/perldoc?Scalar::Util)!
+    Use of this feature requires [Scalar::Util](https://metacpan.org/pod/Scalar::Util)!
 
 - `trigger => CodeRef`
 
@@ -225,17 +225,17 @@ this class. Options:
 
 ## `confess(message) -> BOOM`
 
-["confess" in Carp](http://search.cpan.org/perldoc?Carp#confess) for your convenience.
+["confess" in Carp](https://metacpan.org/pod/Carp#confess) for your convenience.
 
 ## `blessed(value) -> ClassName | undef`
 
-["blessed" in Scalar::Util](http://search.cpan.org/perldoc?Scalar::Util#blessed) for your convenience.
+["blessed" in Scalar::Util](https://metacpan.org/pod/Scalar::Util#blessed) for your convenience.
 
 # MISC
 
 ## import
 
-Importing Mouse will default your class' superclass list to [Mouse::Object](http://search.cpan.org/perldoc?Mouse::Object).
+Importing Mouse will default your class' superclass list to [Mouse::Object](https://metacpan.org/pod/Mouse::Object).
 You may use ["extends"](#extends) to replace the superclass list.
 
 ## unimport
@@ -255,19 +255,19 @@ Perl 5.6.2 or later.
 
 # SEE ALSO
 
-[Mouse::Role](http://search.cpan.org/perldoc?Mouse::Role)
+[Mouse::Role](https://metacpan.org/pod/Mouse::Role)
 
-[Mouse::Spec](http://search.cpan.org/perldoc?Mouse::Spec)
+[Mouse::Spec](https://metacpan.org/pod/Mouse::Spec)
 
-[Moose](http://search.cpan.org/perldoc?Moose)
+[Moose](https://metacpan.org/pod/Moose)
 
-[Moose::Manual](http://search.cpan.org/perldoc?Moose::Manual)
+[Moose::Manual](https://metacpan.org/pod/Moose::Manual)
 
-[Moose::Cookbook](http://search.cpan.org/perldoc?Moose::Cookbook)
+[Moose::Cookbook](https://metacpan.org/pod/Moose::Cookbook)
 
-[Class::MOP](http://search.cpan.org/perldoc?Class::MOP)
+[Class::MOP](https://metacpan.org/pod/Class::MOP)
 
-[Moo](http://search.cpan.org/perldoc?Moo)
+[Moo](https://metacpan.org/pod/Moo)
 
 # AUTHORS
 
@@ -283,7 +283,7 @@ wu-lee
 
 Goro Fuji (gfx) <gfuji@cpan.org>
 
-with plenty of code borrowed from [Class::MOP](http://search.cpan.org/perldoc?Class::MOP) and [Moose](http://search.cpan.org/perldoc?Moose)
+with plenty of code borrowed from [Class::MOP](https://metacpan.org/pod/Class::MOP) and [Moose](https://metacpan.org/pod/Moose)
 
 # BUGS
 
@@ -269,7 +269,7 @@ Mouse::Exporter - make an import() and unimport() just like Mouse.pm
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SYNOPSIS
 
@@ -349,7 +349,7 @@ Mouse::Meta::Attribute - The Mouse attribute metaclass
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 DESCRIPTION
 
@@ -470,7 +470,7 @@ Mouse::Meta::Class - The Mouse class metaclass
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 DESCRIPTION
 
@@ -188,7 +188,7 @@ Mouse::Meta::Method::Accessor - A Mouse method generator for accessors
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SEE ALSO
 
@@ -233,7 +233,7 @@ Mouse::Meta::Method::Constructor - A Mouse method generator for constructors
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SEE ALSO
 
@@ -61,7 +61,7 @@ Mouse::Meta::Method::Delegation - A Mouse method generator for delegation method
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SEE ALSO
 
@@ -65,7 +65,7 @@ Mouse::Meta::Method::Destructor - A Mouse method generator for destructors
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SEE ALSO
 
@@ -54,7 +54,7 @@ Mouse::Meta::Method - A Mouse Method metaclass
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 DESCRIPTION
 
@@ -311,7 +311,7 @@ Mouse::Meta::Module - The common base class of Mouse::Meta::Class and Mouse::Met
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 DESCRIPTION
 
@@ -209,7 +209,7 @@ Mouse::Meta::Role::Application - The Mouse role application class
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SEE ALSO
 
@@ -185,7 +185,7 @@ Mouse::Meta::Role::Composite - An object to represent the set of roles
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SEE ALSO
 
@@ -23,7 +23,7 @@ Mouse::Meta::Role::Method - A Mouse Method metaclass for Roles
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SEE ALSO
 
@@ -131,7 +131,7 @@ Mouse::Meta::Role - The Mouse Role metaclass
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 DESCRIPTION
 
@@ -274,7 +274,7 @@ Mouse::Meta::TypeConstraint - The Mouse Type Constraint metaclass
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 DESCRIPTION
 
@@ -16,7 +16,7 @@ Mouse::Object - The base object for Mouse classes
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 METHODS
 
@@ -755,7 +755,7 @@ Mouse::PurePerl - A Mouse guts in pure Perl
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SEE ALSO
 
@@ -1,7 +1,7 @@
 package Mouse::Role;
 use Mouse::Exporter; # enables strict and warnings
 
-our $VERSION = '2.1.1';
+our $VERSION = '2.2.0';
 
 use Carp         ();
 use Scalar::Util ();
@@ -137,7 +137,7 @@ Mouse::Role - The Mouse Role
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SYNOPSIS
 
@@ -2,7 +2,7 @@ package Mouse::Spec;
 use strict;
 use warnings;
 
-our $VERSION = '2.1.1';
+our $VERSION = '2.2.0';
 
 our $MouseVersion = $VERSION;
 our $MooseVersion = '1.13';
@@ -19,7 +19,7 @@ Mouse::Spec - To what extent Mouse is compatible with Moose
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SYNOPSIS
 
@@ -437,7 +437,7 @@ Mouse::Util::TypeConstraints - Type constraint system for Mouse
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head2 SYNOPSIS
 
@@ -50,7 +50,7 @@ BEGIN{
         },
     );
 
-    our $VERSION = '2.1.1';
+    our $VERSION = '2.2.0';
 
     my $xs = !(defined(&is_valid_class_name) || $ENV{MOUSE_PUREPERL} || $ENV{PERL_ONLY});
 
@@ -411,7 +411,7 @@ Mouse::Util - Utilities for working with Mouse classes
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SYNOPSIS
 
@@ -3,7 +3,7 @@ use 5.006_002;
 
 use Mouse::Exporter; # enables strict and warnings
 
-our $VERSION = '2.1.1';
+our $VERSION = '2.2.0';
 
 use Carp         ();
 use Scalar::Util ();
@@ -155,7 +155,7 @@ Mouse - Moose minus the antlers
 
 =head1 VERSION
 
-This document describes Mouse version 2.1.1
+This document describes Mouse version 2.2.0
 
 =head1 SYNOPSIS
 
@@ -0,0 +1,44 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Test::More;
+use Test::Exception;
+
+{
+    package Boolean;
+
+    sub new
+    {
+        my $self = shift;
+        bless [ shift ], $self;
+    }
+
+    use overload (
+       "0+"     => sub { shift->[0] ? 1 : 0 },
+       fallback => 1,
+    );
+
+    package Foo;
+    use Mouse;
+
+    has flag => (
+        is       => 'ro',
+        isa      => 'Bool',
+    );
+
+    no Mouse;
+}
+
+my $false;
+lives_ok {
+    $false = Foo->new( flag => Boolean->new(0) );
+} 'pseudo false value';
+ok( $false && defined $false->flag && !$false->flag, 'false' );
+
+my $true;
+lives_ok {
+    $true = Foo->new( flag => Boolean->new(1) );
+} 'pseudo true value';
+ok( $true && defined $false->flag && $true->flag, 'true' );
+
+done_testing;
@@ -103,7 +103,13 @@ mouse_tc_Bool(pTHX_ SV* const data PERL_UNUSED_DECL, SV* const sv) {
             return SvNVX(sv) == 1.0;
         }
         else{
-            return FALSE;
+            STRLEN len;
+            char * ptr = SvPV(sv, len);
+            if(len == 1 && ptr[0] == '1'){
+                return TRUE;
+            } else {
+                return FALSE;
+            }
         }
     }
     else{