From: Stevan Little Date: Wed, 28 Jun 2006 01:30:12 +0000 (+0000) Subject: foo X-Git-Tag: 0_03~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7dad276528d940b1475e55f8acfdc9414ba1f6bc;p=gitmo%2FMoose-Autobox.git foo --- diff --git a/lib/Moose/Autobox.pm b/lib/Moose/Autobox.pm index 77fd0c6..c952518 100644 --- a/lib/Moose/Autobox.pm +++ b/lib/Moose/Autobox.pm @@ -7,12 +7,495 @@ use warnings; use Carp qw(confess); use Scalar::Util (); +our $VERSION = '0.03'; + +use base 'autobox'; + +sub import { + (shift)->SUPER::import( + DEFAULT => 'Moose::Autobox::', + UNDEF => 'Moose::Autobox::Undef', + ); +} + +package Moose::Autobox::SCALAR; +# NOTE: +# this doesnt make sense, but +# I need to prevent Moose from +# assiging to @ISA +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Scalar'; + +*does = \&Moose::Object::does; + +package Moose::Autobox::ARRAY; +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Array'; + +*does = \&Moose::Object::does; + +package Moose::Autobox::HASH; +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Hash'; + +*does = \&Moose::Object::does; + +package Moose::Autobox::CODE; +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Code'; + +*does = \&Moose::Object::does; + +1; + +__END__ + +=pod + +=head1 NAME + +Moose::Autobox - Autoboxed for her pleasure + +=head1 SYNOPOSIS + + use Moose::Autobox; + use autobox; + + print 'Print squares from 1 to 10 : '; + print [ 1 .. 10 ]->map(sub { $_ * $_ })->join(', '); + +=head1 CAVEAT + +First, a warning. + +This module is very very very very very very very experimental. It +makes use of a very experimental module (L) and uses some +shiney new technology (L) to accomplish it's goals. + +Use this at your own risk. If it breaks the lamp in the living room +and your mother yells at you, don't come complaining to me. + +Also, as this is so experimental, it's API should not be considered +to be stable. It could very well change in radical ways. + +=head1 DESCRIPTION + +Moose::Autobox provides an implementation of SCALAR, ARRAY, HASH +& CODE for use with L. It does this using a hierarchy of +roles in a manner similar to what Perl 6 I do. This module, +like L and L, was inspired by my work on the +Perl 6 Object Space, and the 'core types' implemented there. + +=head2 A quick word about autobox + +The L module provides the ability for calling 'methods' +on normal Perl values like Scalars, Arrays, Hashes and Code +references. This gives the illusion that Perl's types are first-class +objects. However, this is only an illusion, albeit a very nice one. +I created this module because L itself does not actually +provide an implementation for the Perl types but instead only provides +the 'hooks' for others to add implementation too. + +=head2 Is this for real? or just play? + +My intent is to try and make this module as production worthy as +possible. This may or may not be possible, depending on how well +L works out. At this point, I have high hopes for things +but only time (and more tests and code) will tell. + +=head1 ROLES + +This is a rough diagram of the roles involved to get our 4 +autoboxed types (SCALAR, ARRAY, HASH & CODE). + + +------------------------+-------------------------------+ + | Identity | Behavioral | + +------------------------+-------------------------------+ + | Item | | + | Undef | | + | Defined | | + | Scalar* <-|- String, Number <--+ | + | Ref | |-- Value | + | Array* <-|- List <------------+ | + | Hash* | | + | Code* | | + | | | + +------------------------+-------------------------------+ + + * indicates actual autoboxed types + +=head1 TODO + +=over 4 + +=item More docs + +=item More tests + +=back + +=head1 NOTES + + - String, Number & List are currently the only 'Value's. + + - Indexed is pretty much an interface, we probably will + need more of these (see Smalltalk Collection Trait + Refactoring) + +=head1 BUGS + +All complex software has bugs lurking in it, and this module is no +exception. If you find a bug please either email me, or add the bug +to cpan-RT. + +=head1 AUTHOR + +Stevan Little Estevan@iinteractive.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright 2006 by Infinity Interactive, Inc. + +L + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +package Moose::Autobox; + +use strict; +use warnings; + +use Carp qw(confess); +use Scalar::Util (); + +our $VERSION = '0.02'; + +package Moose::Autobox::SCALAR; +# NOTE: +# this doesnt make sense, but +# I need to prevent Moose from +# assiging to @ISA +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Scalar'; + +*does = \&Moose::Object::does; + +package Moose::Autobox::ARRAY; +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Array'; + +*does = \&Moose::Object::does; + +package Moose::Autobox::HASH; +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Hash'; + +*does = \&Moose::Object::does; + +package Moose::Autobox::CODE; +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Code'; + +*does = \&Moose::Object::does; + +1; + +__END__ + +=pod + +=head1 NAME + +Moose::Autobox - Autoboxed for her pleasure + +=head1 SYNOPOSIS + + use Moose::Autobox; + use autobox; + + print 'Print squares from 1 to 10 : '; + print [ 1 .. 10 ]->map(sub { $_ * $_ })->join(', '); + +=head1 CAVEAT + +First, a warning. + +This module is very very very very very very very experimental. It +makes use of a very experimental module (L) and uses some +shiney new technology (L) to accomplish it's goals. + +Use this at your own risk. If it breaks the lamp in the living room +and your mother yells at you, don't come complaining to me. + +Also, as this is so experimental, it's API should not be considered +to be stable. It could very well change in radical ways. + +=head1 DESCRIPTION + +Moose::Autobox provides an implementation of SCALAR, ARRAY, HASH +& CODE for use with L. It does this using a hierarchy of +roles in a manner similar to what Perl 6 I do. This module, +like L and L, was inspired by my work on the +Perl 6 Object Space, and the 'core types' implemented there. + +=head2 A quick word about autobox + +The L module provides the ability for calling 'methods' +on normal Perl values like Scalars, Arrays, Hashes and Code +references. This gives the illusion that Perl's types are first-class +objects. However, this is only an illusion, albeit a very nice one. +I created this module because L itself does not actually +provide an implementation for the Perl types but instead only provides +the 'hooks' for others to add implementation too. + +=head2 Is this for real? or just play? + +My intent is to try and make this module as production worthy as +possible. This may or may not be possible, depending on how well +L works out. At this point, I have high hopes for things +but only time (and more tests and code) will tell. + +=head1 ROLES + +This is a rough diagram of the roles involved to get our 4 +autoboxed types (SCALAR, ARRAY, HASH & CODE). + + +------------------------+-------------------------------+ + | Identity | Behavioral | + +------------------------+-------------------------------+ + | Item | | + | Undef | | + | Defined | | + | Scalar* <-|- String, Number <--+ | + | Ref | |-- Value | + | Array* <-|- List <------------+ | + | Hash* | | + | Code* | | + | | | + +------------------------+-------------------------------+ + + * indicates actual autoboxed types + +=head1 TODO + +=over 4 + +=item More docs + +=item More tests + +=back + +=head1 NOTES + + - String, Number & List are currently the only 'Value's. + + - Indexed is pretty much an interface, we probably will + need more of these (see Smalltalk Collection Trait + Refactoring) + +=head1 BUGS + +All complex software has bugs lurking in it, and this module is no +exception. If you find a bug please either email me, or add the bug +to cpan-RT. + +=head1 AUTHOR + +Stevan Little Estevan@iinteractive.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright 2006 by Infinity Interactive, Inc. + +L + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +package Moose::Autobox; + +use strict; +use warnings; + +use Carp qw(confess); +use Scalar::Util (); + +our $VERSION = '0.02'; + +package Moose::Autobox::SCALAR; +# NOTE: +# this doesnt make sense, but +# I need to prevent Moose from +# assiging to @ISA +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Scalar'; + +*does = \&Moose::Object::does; + +package Moose::Autobox::ARRAY; +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Array'; + +*does = \&Moose::Object::does; + +package Moose::Autobox::HASH; +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Hash'; + +*does = \&Moose::Object::does; + +package Moose::Autobox::CODE; +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Code'; + +*does = \&Moose::Object::does; + +1; + +__END__ + +=pod + +=head1 NAME + +Moose::Autobox - Autoboxed for her pleasure + +=head1 SYNOPOSIS + + use Moose::Autobox; + use autobox; + + print 'Print squares from 1 to 10 : '; + print [ 1 .. 10 ]->map(sub { $_ * $_ })->join(', '); + +=head1 CAVEAT + +First, a warning. + +This module is very very very very very very very experimental. It +makes use of a very experimental module (L) and uses some +shiney new technology (L) to accomplish it's goals. + +Use this at your own risk. If it breaks the lamp in the living room +and your mother yells at you, don't come complaining to me. + +Also, as this is so experimental, it's API should not be considered +to be stable. It could very well change in radical ways. + +=head1 DESCRIPTION + +Moose::Autobox provides an implementation of SCALAR, ARRAY, HASH +& CODE for use with L. It does this using a hierarchy of +roles in a manner similar to what Perl 6 I do. This module, +like L and L, was inspired by my work on the +Perl 6 Object Space, and the 'core types' implemented there. + +=head2 A quick word about autobox + +The L module provides the ability for calling 'methods' +on normal Perl values like Scalars, Arrays, Hashes and Code +references. This gives the illusion that Perl's types are first-class +objects. However, this is only an illusion, albeit a very nice one. +I created this module because L itself does not actually +provide an implementation for the Perl types but instead only provides +the 'hooks' for others to add implementation too. + +=head2 Is this for real? or just play? + +My intent is to try and make this module as production worthy as +possible. This may or may not be possible, depending on how well +L works out. At this point, I have high hopes for things +but only time (and more tests and code) will tell. + +=head1 ROLES + +This is a rough diagram of the roles involved to get our 4 +autoboxed types (SCALAR, ARRAY, HASH & CODE). + + +------------------------+-------------------------------+ + | Identity | Behavioral | + +------------------------+-------------------------------+ + | Item | | + | Undef | | + | Defined | | + | Scalar* <-|- String, Number <--+ | + | Ref | |-- Value | + | Array* <-|- List <------------+ | + | Hash* | | + | Code* | | + | | | + +------------------------+-------------------------------+ + + * indicates actual autoboxed types + +=head1 TODO + +=over 4 + +=item More docs + +=item More tests + +=back + +=head1 NOTES + + - String, Number & List are currently the only 'Value's. + + - Indexed is pretty much an interface, we probably will + need more of these (see Smalltalk Collection Trait + Refactoring) + +=head1 BUGS + +All complex software has bugs lurking in it, and this module is no +exception. If you find a bug please either email me, or add the bug +to cpan-RT. + +=head1 AUTHOR + +Stevan Little Estevan@iinteractive.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright 2006 by Infinity Interactive, Inc. + +L + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +package Moose::Autobox; + +use strict; +use warnings; + +use Carp qw(confess); +use Scalar::Util (); + our $VERSION = '0.02'; - -sub import { - eval q| -package # hide from PAUSE - SCALAR; + +package Moose::Autobox::SCALAR; # NOTE: # this doesnt make sense, but # I need to prevent Moose from @@ -23,33 +506,186 @@ with 'Moose::Autobox::Scalar'; *does = \&Moose::Object::does; -package # hide from PAUSE - ARRAY; +package Moose::Autobox::ARRAY; use base 'UNIVERSAL'; use Moose; with 'Moose::Autobox::Array'; *does = \&Moose::Object::does; -package # hide from PAUSE - HASH; +package Moose::Autobox::HASH; use base 'UNIVERSAL'; use Moose; with 'Moose::Autobox::Hash'; *does = \&Moose::Object::does; -package # hide from PAUSE - CODE; +package Moose::Autobox::CODE; use base 'UNIVERSAL'; use Moose; with 'Moose::Autobox::Code'; +*does = \&Moose::Object::does; + +1; + +__END__ + +=pod + +=head1 NAME + +Moose::Autobox - Autoboxed for her pleasure + +=head1 SYNOPOSIS + + use Moose::Autobox; + use autobox; + + print 'Print squares from 1 to 10 : '; + print [ 1 .. 10 ]->map(sub { $_ * $_ })->join(', '); + +=head1 CAVEAT + +First, a warning. + +This module is very very very very very very very experimental. It +makes use of a very experimental module (L) and uses some +shiney new technology (L) to accomplish it's goals. + +Use this at your own risk. If it breaks the lamp in the living room +and your mother yells at you, don't come complaining to me. + +Also, as this is so experimental, it's API should not be considered +to be stable. It could very well change in radical ways. + +=head1 DESCRIPTION + +Moose::Autobox provides an implementation of SCALAR, ARRAY, HASH +& CODE for use with L. It does this using a hierarchy of +roles in a manner similar to what Perl 6 I do. This module, +like L and L, was inspired by my work on the +Perl 6 Object Space, and the 'core types' implemented there. + +=head2 A quick word about autobox + +The L module provides the ability for calling 'methods' +on normal Perl values like Scalars, Arrays, Hashes and Code +references. This gives the illusion that Perl's types are first-class +objects. However, this is only an illusion, albeit a very nice one. +I created this module because L itself does not actually +provide an implementation for the Perl types but instead only provides +the 'hooks' for others to add implementation too. + +=head2 Is this for real? or just play? + +My intent is to try and make this module as production worthy as +possible. This may or may not be possible, depending on how well +L works out. At this point, I have high hopes for things +but only time (and more tests and code) will tell. + +=head1 ROLES + +This is a rough diagram of the roles involved to get our 4 +autoboxed types (SCALAR, ARRAY, HASH & CODE). + + +------------------------+-------------------------------+ + | Identity | Behavioral | + +------------------------+-------------------------------+ + | Item | | + | Undef | | + | Defined | | + | Scalar* <-|- String, Number <--+ | + | Ref | |-- Value | + | Array* <-|- List <------------+ | + | Hash* | | + | Code* | | + | | | + +------------------------+-------------------------------+ + + * indicates actual autoboxed types + +=head1 TODO + +=over 4 + +=item More docs + +=item More tests + +=back + +=head1 NOTES + + - String, Number & List are currently the only 'Value's. + + - Indexed is pretty much an interface, we probably will + need more of these (see Smalltalk Collection Trait + Refactoring) + +=head1 BUGS + +All complex software has bugs lurking in it, and this module is no +exception. If you find a bug please either email me, or add the bug +to cpan-RT. + +=head1 AUTHOR + +Stevan Little Estevan@iinteractive.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright 2006 by Infinity Interactive, Inc. + +L + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +package Moose::Autobox; + +use strict; +use warnings; + +use Carp qw(confess); +use Scalar::Util (); + +our $VERSION = '0.02'; + +package Moose::Autobox::SCALAR; +# NOTE: +# this doesnt make sense, but +# I need to prevent Moose from +# assiging to @ISA +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Scalar'; + *does = \&Moose::Object::does; - |; - confess 'Could not create autobox packages because - ' . $@ if $@; -} +package Moose::Autobox::ARRAY; +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Array'; + +*does = \&Moose::Object::does; + +package Moose::Autobox::HASH; +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Hash'; + +*does = \&Moose::Object::does; + +package Moose::Autobox::CODE; +use base 'UNIVERSAL'; +use Moose; +with 'Moose::Autobox::Code'; + +*does = \&Moose::Object::does; + 1; __END__ diff --git a/lib/Moose/Autobox/Array.pm b/lib/Moose/Autobox/Array.pm index 03dc46b..e236fc9 100644 --- a/lib/Moose/Autobox/Array.pm +++ b/lib/Moose/Autobox/Array.pm @@ -1,9 +1,9 @@ package Moose::Autobox::Array; use Moose::Role 'with'; use Perl6::Junction; -use autobox; +use Moose::Autobox; -our $VERSION = '0.02'; +our $VERSION = '0.03'; with 'Moose::Autobox::Ref', 'Moose::Autobox::List', diff --git a/lib/Moose/Autobox/Code.pm b/lib/Moose/Autobox/Code.pm index 74ceb27..0dabc53 100644 --- a/lib/Moose/Autobox/Code.pm +++ b/lib/Moose/Autobox/Code.pm @@ -1,8 +1,8 @@ package Moose::Autobox::Code; use Moose::Role 'with'; -use autobox; +use Moose::Autobox; -our $VERSION = '0.01'; +our $VERSION = '0.02'; with 'Moose::Autobox::Ref'; diff --git a/lib/Moose/Autobox/List.pm b/lib/Moose/Autobox/List.pm index 9ab4c99..43861ee 100644 --- a/lib/Moose/Autobox/List.pm +++ b/lib/Moose/Autobox/List.pm @@ -1,9 +1,9 @@ package Moose::Autobox::List; use Moose::Role 'with', 'requires'; -use autobox; +use Moose::Autobox; -our $VERSION = '0.01'; +our $VERSION = '0.02'; with 'Moose::Autobox::Value'; diff --git a/t/001_basic.t b/t/001_basic.t index fc0f00b..fd2bf93 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -10,7 +10,7 @@ BEGIN { use_ok('Moose::Autobox::Undef'); } -use autobox UNDEF => 'Moose::Autobox::Undef'; +use Moose::Autobox; # SCALAR & UNDEF diff --git a/t/002_role_hierarchy.t b/t/002_role_hierarchy.t index 332b8fe..25773a4 100644 --- a/t/002_role_hierarchy.t +++ b/t/002_role_hierarchy.t @@ -9,30 +9,30 @@ BEGIN { use_ok('Moose::Autobox'); } -ok(SCALAR->does('Moose::Autobox::Scalar'), '... SCALAR does Moose::Autobox::Scalar'); - ok(SCALAR->does('Moose::Autobox::String'), '... SCALAR does Moose::Autobox::String'); - ok(SCALAR->does('Moose::Autobox::Number'), '... SCALAR does Moose::Autobox::Number'); - ok(SCALAR->does('Moose::Autobox::Value'), '... SCALAR does Moose::Autobox::Value'); - ok(SCALAR->does('Moose::Autobox::Defined'), '... SCALAR does Moose::Autobox::Defined'); - ok(SCALAR->does('Moose::Autobox::Item'), '... SCALAR does Moose::Autobox::Item'); +ok(Moose::Autobox::SCALAR->does('Moose::Autobox::Scalar'), '... SCALAR does Moose::Autobox::Scalar'); + ok(Moose::Autobox::SCALAR->does('Moose::Autobox::String'), '... SCALAR does Moose::Autobox::String'); + ok(Moose::Autobox::SCALAR->does('Moose::Autobox::Number'), '... SCALAR does Moose::Autobox::Number'); + ok(Moose::Autobox::SCALAR->does('Moose::Autobox::Value'), '... SCALAR does Moose::Autobox::Value'); + ok(Moose::Autobox::SCALAR->does('Moose::Autobox::Defined'), '... SCALAR does Moose::Autobox::Defined'); + ok(Moose::Autobox::SCALAR->does('Moose::Autobox::Item'), '... SCALAR does Moose::Autobox::Item'); -ok(ARRAY->does('Moose::Autobox::Array'), '... ARRAY does Moose::Autobox::Array'); - ok(ARRAY->does('Moose::Autobox::List'), '... ARRAY does Moose::Autobox::List'); - ok(ARRAY->does('Moose::Autobox::Indexed'), '... ARRAY does Moose::Autobox::Indexed'); - ok(ARRAY->does('Moose::Autobox::Ref'), '... ARRAY does Moose::Autobox::Ref'); - ok(ARRAY->does('Moose::Autobox::Defined'), '... ARRAY does Moose::Autobox::Defined'); - ok(ARRAY->does('Moose::Autobox::Item'), '... ARRAY does Moose::Autobox::Item'); +ok(Moose::Autobox::ARRAY->does('Moose::Autobox::Array'), '... ARRAY does Moose::Autobox::Array'); + ok(Moose::Autobox::ARRAY->does('Moose::Autobox::List'), '... ARRAY does Moose::Autobox::List'); + ok(Moose::Autobox::ARRAY->does('Moose::Autobox::Indexed'), '... ARRAY does Moose::Autobox::Indexed'); + ok(Moose::Autobox::ARRAY->does('Moose::Autobox::Ref'), '... ARRAY does Moose::Autobox::Ref'); + ok(Moose::Autobox::ARRAY->does('Moose::Autobox::Defined'), '... ARRAY does Moose::Autobox::Defined'); + ok(Moose::Autobox::ARRAY->does('Moose::Autobox::Item'), '... ARRAY does Moose::Autobox::Item'); -ok(HASH->does('Moose::Autobox::Hash'), '... HASH does Moose::Autobox::Hash'); - ok(HASH->does('Moose::Autobox::Indexed'), '... HASH does Moose::Autobox::Indexed'); - ok(HASH->does('Moose::Autobox::Ref'), '... HASH does Moose::Autobox::Ref'); - ok(HASH->does('Moose::Autobox::Defined'), '... HASH does Moose::Autobox::Defined'); - ok(HASH->does('Moose::Autobox::Item'), '... HASH does Moose::Autobox::Item'); +ok(Moose::Autobox::HASH->does('Moose::Autobox::Hash'), '... HASH does Moose::Autobox::Hash'); + ok(Moose::Autobox::HASH->does('Moose::Autobox::Indexed'), '... HASH does Moose::Autobox::Indexed'); + ok(Moose::Autobox::HASH->does('Moose::Autobox::Ref'), '... HASH does Moose::Autobox::Ref'); + ok(Moose::Autobox::HASH->does('Moose::Autobox::Defined'), '... HASH does Moose::Autobox::Defined'); + ok(Moose::Autobox::HASH->does('Moose::Autobox::Item'), '... HASH does Moose::Autobox::Item'); -ok(CODE->does('Moose::Autobox::Code'), '... CODE does Moose::Autobox::Code'); - ok(CODE->does('Moose::Autobox::Ref'), '... CODE does Moose::Autobox::Ref'); - ok(CODE->does('Moose::Autobox::Defined'), '... CODE does Moose::Autobox::Defined'); - ok(CODE->does('Moose::Autobox::Item'), '... CODE does Moose::Autobox::Item'); +ok(Moose::Autobox::CODE->does('Moose::Autobox::Code'), '... CODE does Moose::Autobox::Code'); + ok(Moose::Autobox::CODE->does('Moose::Autobox::Ref'), '... CODE does Moose::Autobox::Ref'); + ok(Moose::Autobox::CODE->does('Moose::Autobox::Defined'), '... CODE does Moose::Autobox::Defined'); + ok(Moose::Autobox::CODE->does('Moose::Autobox::Item'), '... CODE does Moose::Autobox::Item'); diff --git a/t/003_p6_example.t b/t/003_p6_example.t index 273e478..054f966 100644 --- a/t/003_p6_example.t +++ b/t/003_p6_example.t @@ -19,7 +19,7 @@ This comes from one of the examples in the Pugs distro. { package Units::Bytes; use Moose::Role; - use autobox; + use Moose::Autobox; sub bytes { $_[0] } sub kilobytes { $_[0] * 1024 } @@ -38,8 +38,8 @@ This comes from one of the examples in the Pugs distro. } { - package SCALAR; - use Moose; + package Moose::Autobox::SCALAR; + use Moose 'with'; with 'Units::Bytes'; } @@ -48,7 +48,7 @@ sub testing_bytes { } { - use autobox; + use Moose::Autobox; is(5->bytes, 5, '... got 5 bytes'); is(5->kilobytes, 5120, '... got 5 kilobytes'); diff --git a/t/004_list_compressions.t b/t/004_list_compressions.t index ebbaef4..4721dfa 100644 --- a/t/004_list_compressions.t +++ b/t/004_list_compressions.t @@ -9,7 +9,7 @@ BEGIN { use_ok('Moose::Autobox'); } -use autobox; +use Moose::Autobox; is_deeply( [ 1 .. 5 ]->map(sub { $_ * $_ }), diff --git a/t/005_string.t b/t/005_string.t index 1a33470..086ef26 100644 --- a/t/005_string.t +++ b/t/005_string.t @@ -10,7 +10,7 @@ BEGIN { use_ok('Moose::Autobox'); } -use autobox; +use Moose::Autobox; is('Hello World'->lc, 'hello world', '... $str->lc'); is('Hello World'->uc, 'HELLO WORLD', '... $str->uc');