diff -Nru libbread-board-perl-0.32/Changes libbread-board-perl-0.37/Changes --- libbread-board-perl-0.32/Changes 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/Changes 2019-06-28 23:19:54.000000000 +0000 @@ -1,366 +1,304 @@ Revision history for Bread-Board -0.32 2014-06-03 - - fixes to arrayref dependencies (dakkar, #35) - -0.31 2014-05-08 - - allow specifying dependency values as arrayrefs, which will resolve to an - arrayref containing the resolved service values (dakkar, #34) - -0.30 2014-02-02 - - fix deprecated use of Class::MOP::load_class (Caleb Cushing, #33) - -0.29 2013-11-21 - - Fix deprecated enum syntax - -0.28 2013-08-30 - - Allow overriding of services and containers. This is useful when using - the common pattern of "sub BUILD { my $self = shift; container $self => - as { ... } }" since the BUILD method in a subclass can modify existing - services and containers that were defined in a superclass, rather than - only being able to replace them (Florian Ragwitz, #26, #27). - -0.27 2013-08-06 - - allow the 'container $obj' sugar for parameterized containers (Florian - Ragwitz, #25) - -0.26 2013-08-01 - - allow cloning containers with parameterized subcontainers (Florian - Ragwitz, #22) - - allow referencing parent services from parameterized subcontainers - (Florian Ragwitz, #23) - - deprecate special case in path traversal where a path component with the - name of the current container was ignored (doy, #20) - - fix setting the current container multiple times from outside of a - container (doy) - - make some error messages more helpful (Jason Galea, #14) - - doc improvements (Sterling Hanenkamp, zdk, Philippe Bruhat, and Gabor - Szabo; #15, #17, #19, #21) - - remove the (unmaintained) Bread::Board::GraphViz - -0.25 2011-10-20 - * Bread::Board - - the container sugar was misbehaving - (since April 2010 apparently), so - we have fixed it and clarified it - -0.24 2011-10-15 - * Bread::Board::Container - - make sure to clone subcontainers, - this is necessary for parameterized - containers to retain their connections - - * Bread::Board::Traversable - - add some errors, be a little more - defensive - -0.23 2011-10-14 - * Bread::Board::Container::Parameterized - - retain control of names of the generated - containers, so if your the container being - generated has a name, it keeps it. - - this makes these containers more - addressable when composed into - higher level containers - - this helps when subclassing - parameterized containers - - switch the generated containers to be - created with builder instead of default - - also helps when subclassing - parameterized containers as well - - * t/046_custom_parameter_service.t - - fixing the error about Moose deprecations - -0.22 2011-10-03 - - When inferring a service for a type, allow subclasses to fulfill - discovered types. - - Converted to Dist::Zilla +0.37 2019-06-28 + [ DOCUMENTATION ] + - Fixed pod error as reported by CPANTS. (GH#67, Mohammad S Anwar) + - remove extraneous character from synopsis + - Remove extraneous character from synopsis (GH#66, Graham Knop) + + [ MISC ] + - Fix some broken formatting in 'Changes'. (GH#65, Dave Rolsky) + + [ STATISTICS ] + - code churn: 10 files changed, 137 insertions(+), 70 deletions(-) + +0.36 2017-10-15 + [ BUG FIXES ] + - fix pod error. (Mohammad S Anwar, GH#63) + + [ MISC ] + - Reverting the changes of #53, as it breaks a few packages that are + using `also => 'Bread::Board'` in their import, and the benefit we + get from freeing ourselves from Moose::Exporter isn't that huge. + + [ STATISTICS ] + - code churn: 4 files changed, 40 insertions(+), 44 deletions(-) + +0.35 2017-07-31 + [ BUG FIXES ] + - fixed Bread::Board::Dumper to dump parameterized containers - + previously it would just ignore them entirely (#56, Dave Rolsky) + - Moo classes were losing their method modifiers because of bad + interaction with Class::MOP::class_of(). (GH#61) + + [ ENHANCEMENTS ] + - Using Bread::Board no longer enables strict and warnings in the + calling package. (#53, Dave Rolsky) + - Bread::Board::Dumper now sorts services and sub containers - + previously these came out in a random order each time (#56, Dave + Rolsky) + - allow a service or literal to be undefined. (#54, Dave Rolsky) + + [ STATISTICS ] + - code churn: 13 files changed, 425 insertions(+), 237 deletions(-) + +0.34 2016-03-28 + - Add test messages to tests which did not have them, (#50, Alex + Balhatchet) + + [ DOCUMENTATION ] + - add missing module abstracts. (GH#49, Alex Balhatchet, GH#16, + Sterling Hanenkamp) + + [ ENHANCEMENTS ] + - SetterInjection can now accept any constructor. (#43, dakkar) + + [ STATISTICS ] + - code churn: 37 files changed, 462 insertions(+), 395 deletions(-) + +0.33 2015-04-26 + - add 'literal' keyword (Yanick Champoux, #31) + - added documentation for most of the classes (dakkar, sponsored by + Net-a-Porter.com) + + [ STATISTICS ] + - code churn: 35 files changed, 1016 insertions(+), 375 deletions(-) + +0.32 2014-06-03 + - fixes to arrayref dependencies (dakkar, #35) + +0.31 2014-05-08 + - allow specifying dependency values as arrayrefs, which will resolve to + an arrayref containing the resolved service values (dakkar, #34) + +0.30 2014-02-02 + - fix deprecated use of Class::MOP::load_class (Caleb Cushing, #33) + +0.29 2013-11-21 + - Fix deprecated enum syntax + +0.28 2013-08-30 + - Allow overriding of services and containers. This is useful when using + the common pattern of "sub BUILD { my $self = shift; container $self => + as { ... } }" since the BUILD method in a subclass can modify existing + services and containers that were defined in a superclass, rather than + only being able to replace them (Florian Ragwitz, #26, #27). + +0.27 2013-08-06 + - allow the 'container $obj' sugar for parameterized containers (Florian + Ragwitz, #25) + +0.26 2013-08-01 + - allow cloning containers with parameterized subcontainers (Florian + Ragwitz, #22) + - allow referencing parent services from parameterized subcontainers + (Florian Ragwitz, #23) + - deprecate special case in path traversal where a path component with + the name of the current container was ignored (doy, #20) + - fix setting the current container multiple times from outside of a + container (doy) + - make some error messages more helpful (Jason Galea, #14) + - doc improvements (Sterling Hanenkamp, zdk, Philippe Bruhat, and Gabor + Szabo; #15, #17, #19, #21) + - remove the (unmaintained) Bread::Board::GraphViz + +0.25 2011-10-20 + - Bread::Board - the container sugar was misbehaving (since April 2010 + apparently), so we have fixed it and clarified it + +0.24 2011-10-15 + - Bread::Board::Container - make sure to clone subcontainers, this is + necessary for parameterized containers to retain their connections + - Bread::Board::Traversable - add some errors, be a little more defensive + +0.23 2011-10-14 + - Bread::Board::Container::Parameterized - retain control of names of the + generated containers, so if your the container being generated has a + name, it keeps it. - this makes these containers more addressable when + composed into higher level containers - this helps when subclassing + parameterized containers - switch the generated containers to be + created with builder instead of default - also helps when subclassing + parameterized containers as well + - t/046_custom_parameter_service.t - fixing the error about Moose + deprecations + +0.22 2011-10-03 + - When inferring a service for a type, allow subclasses to fulfill + discovered types. + - Converted to Dist::Zilla 0.21 2011-09-06 - * Bread::Board - - Allow service() and alias() sugar functions to - return the newly-created objects if the context - container is not defined. (thanks to kip hampton) - - added tests for this - - this module is just an exporter, so it does not - need to 'use Moose' (thanks to Tomas Doran) - - - fixed some spelling and grammar errors - (thanks to ben hengst and Brad Bowman) - - * Bread::Board::Service::WithParameters - - parameters attribute now has a builder instead - of a default, so as to allow better tweaking - in subclasses (thanks to Andre Walker) - - added tests for this + - Bread::Board - Allow service() and alias() sugar functions to return + the newly-created objects if the context container is not defined. + (thanks to kip hampton) - added tests for this - this module is just an + exporter, so it does not need to 'use Moose' (thanks to Tomas Doran) + - fixed some spelling and grammar errors (thanks to ben hengst and Brad + Bowman) + - Bread::Board::Service::WithParameters - parameters attribute now has a + builder instead of a default, so as to allow better tweaking in + subclasses (thanks to Andre Walker) - added tests for this 0.20 2011-06-13 - * Bread::Board::Lifecycle::Singleton - - fix bug in singletons with circular - refs (thanks to doy) - - added tests for this (thanks to perigrin) + - Bread::Board::Lifecycle::Singleton - fix bug in singletons with + circular refs (thanks to doy) - added tests for this (thanks to + perigrin) 0.19 2011-06-01 - * Bread::Board::GraphViz - - added by jrockway, this allows you to visualise - a Bread::Board system using GraphViz - - note that this is optional and requires you - to install optional dependencies - - * Bread::Board::Service::Alias - - add the ability to alias services under - another name (thanks to doy) - - added tests for this - - * Bread::Board::Service::Inferred - - improving edge cases (thanks to doy) - - * Bread::Board::Service::* - - several code improvements (thanks to doy) - - * Bread::Board::Service - - allow for custom Lifecycles by using the "+" - prefix (thanks to jasonmay) - - added tests for this + - Bread::Board::GraphViz - added by jrockway, this allows you to + visualise a Bread::Board system using GraphViz - note that this is + optional and requires you to install optional dependencies + - Bread::Board::Service::Alias - add the ability to alias services under + another name (thanks to doy) - added tests for this + - Bread::Board::Service::Inferred - improving edge cases (thanks to doy) + - Bread::Board::Service::* - several code improvements (thanks to doy) + - Bread::Board::Service - allow for custom Lifecycles by using the "+" + prefix (thanks to jasonmay) - added tests for this 0.18 2011-04-13 - * Bread::Board::Service::WithParameters - - added has_parameter_defaults method to check - if a parameter has default values - * Bread::Board::Service::WithDependencies - - added a check for has_parameter_defaults before - we make a Thunk - - added test for this (thanks to rafl) + - Bread::Board::Service::WithParameters - added has_parameter_defaults + method to check if a parameter has default values + - Bread::Board::Service::WithDependencies - added a check for + has_parameter_defaults before we make a Thunk - added test for this + (thanks to rafl) 0.17 2011-02-22 - * Bread::Board::Service::Inferred - - make recrusive inferrence work - - add tests for this - - * Bread::Board::Manual::Concepts::Advanced - - small doc update about subclassing and - the name parameter, resolving RT#63124 - (thanks to Evan Haas) - - !! POSSIBLE BACK COMPAT BREAKAGE !! - * Bread::Board::Traversal - - make relative parent path traversal more sane, there - should be no more need for excessive ../../ stuff in - dependency service paths (thanks doy) - - adjust tests accordingly - - this should fix RT#64478 as well + - Bread::Board::Service::Inferred - make recrusive inferrence work - add + tests for this + - Bread::Board::Manual::Concepts::Advanced - small doc update about + subclassing and the name parameter, resolving RT#63124 (thanks to Evan + Haas) + - POSSIBLE BACK COMPAT BREAKAGE !! + - Bread::Board::Traversal - make relative parent path traversal more + sane, there should be no more need for excessive ../../ stuff in + dependency service paths (thanks doy) - adjust tests accordingly - this + should fix RT#64478 as well 0.16 2011-01-10 - * Bread::Board::service sugar - - adding the 'service_class' param for the - service sugar function which allows you - to pass in a custom service subclass - - added tests for this (062_service_class_w_sugar.t) - - * Bread::Board::Dependency - - added the service_params attribute here - so that it is possible to pass in parameters - when you depend on a service which requires them - - added tests for this (045_parameters_in_dependency.t) - - * Bread::Board::Service::Inferred - - when a typemapped service is created it is now - named with the special 'type:' prefix. This allows - you to depend on a typemapped service in a - non-typemapped service - - added tests for this (079_depending_on_type.t) - - * Bread::Board::Traversable - - improving the error messages when a container/service - is not found + - Bread::Board::service sugar - adding the 'service_class' param for the + service sugar function which allows you to pass in a custom service + subclass - added tests for this (062_service_class_w_sugar.t) + - Bread::Board::Dependency - added the service_params attribute here so + that it is possible to pass in parameters when you depend on a service + which requires them - added tests for this + (045_parameters_in_dependency.t) + - Bread::Board::Service::Inferred - when a typemapped service is created + it is now named with the special 'type:' prefix. This allows you to + depend on a typemapped service in a non-typemapped service - added + tests for this (079_depending_on_type.t) + - Bread::Board::Traversable - improving the error messages when a + container/service is not found 0.15 2010-09-30 - * Bread::Board::Service - - removed the MooseX::Param dependency - and implemented it internally so that - we have more control - - * Bread::Board::Types - - the Bread::Board::Service::Dependencies - type now can also coerce ArrayRef[Str] - and HashRef[Str] types correctly (doy) - - * Bread::Board::Service::WithDependencies - - we now only create a ::Deferred::Thunk - object if we have non-optional params - * Bread::Board::Service::WithParameters - - added the has_required_parameters - method, to see if there are any - non-optional parameters - - added tests for both the above - - !! NEW EXPERIMENTAL FEATURE !! - - * Bread::Board - - added the typemap and infer keyword - to help in the mapping of types and - construction of inferred services - - added tests for this - - * Bread::Board::Container - - added the typemap feature and added - the ->resolve( type => $type ) call - - added tests for this - - * Bread::Board::Service::Inferred - - added this and tests for it - - * Bread::Board::Manual::Concepts::Typemap - - added this to help explain the - typemap feature + - Bread::Board::Service - removed the MooseX::Param dependency and + implemented it internally so that we have more control + - Bread::Board::Types - the Bread::Board::Service::Dependencies type now + can also coerce ArrayRef[Str] and HashRef[Str] types correctly (doy) + - Bread::Board::Service::WithDependencies - we now only create a + ::Deferred::Thunk object if we have non-optional params + - Bread::Board::Service::WithParameters - added the + has_required_parameters method, to see if there are any non-optional + parameters - added tests for both the above + - NEW EXPERIMENTAL FEATURE !! + - Bread::Board - added the typemap and infer keyword to help in the + mapping of types and construction of inferred services - added tests + for this + - Bread::Board::Container - added the typemap feature and added the + ->resolve( type => $type ) call - added tests for this + - Bread::Board::Service::Inferred - added this and tests for it + - Bread::Board::Manual::Concepts::Typemap - added this to help explain + the typemap feature 0.14 2010-08-24 - * Bread::Board::Container - - added the ->resolve method to replace - the ->fetch( $service )->get pattern - that annoys mst so much. - - adjusted all the tests to account - for this change. - - adjusted all the docs to now use - this approach instead - - - now using Try::Tiny for all exception - handling (except the Deferred service) - - * Bread::Board::Service::WithDependencies - - if you want to depend on a parameterized - service, now you can and it will return - a Bread::Board::Service::Deferred::Thunk - that you can call ->inflate on and pass - in the parameters for it. - - added tests for this - - * Bread::Board::Service::Deferred::Thunk - - added this + tests for it + - Bread::Board::Container - added the ->resolve method to replace the + ->fetch( $service )->get pattern that annoys mst so much. - adjusted + all the tests to account for this change. - adjusted all the docs to + now use this approach instead + - now using Try::Tiny for all exception handling (except the Deferred + service) + - Bread::Board::Service::WithDependencies - if you want to depend on a + parameterized service, now you can and it will return a + Bread::Board::Service::Deferred::Thunk that you can call ->inflate on + and pass in the parameters for it. - added tests for this + - Bread::Board::Service::Deferred::Thunk - added this + tests for it 0.13 2010-04-23 - * Bread::Board - - making the include keyword handle - compilation errors better (doy) - - added test for this - - * Bread::Board::Container - Bread::Board::Container::Parameterized - - it is now possible to store parameterized - containers within regular containers and - have them behave properly - - added tests for this - - * Bread::Board::Manual::Example::* - - adding some examples of ways to use - Bread::Board to the manual - - added tests to confirm they work + - Bread::Board - making the include keyword handle compilation errors + better (doy) - added test for this + - Bread::Board::Container Bread::Board::Container::Parameterized - it is + now possible to store parameterized containers within regular + containers and have them behave properly - added tests for this + - Bread::Board::Manual::Example::* - adding some examples of ways to use + Bread::Board to the manual - added tests to confirm they work 0.12 2010-04-18 - * Bread::Board - - added the `include` keyword which will evaluate - an external file within your Bread::Board - configuration - - added tests for this - - added support for parameterized containers - - added tests for this - - the 'container' keyword will now accept an - instance of Bread::Board::Container instead - of the name, this makes subclassing easier - - added tests for this - - + Bread::Board::Container::Parameterized - - added this module and tests - - + Bread::Baord::Manual - - moved, re-organizad and added too the docs - that were previously in Bread::Board.pm + - Bread::Board - added the `include` keyword which will evaluate an + external file within your Bread::Board configuration - added tests for + this - added support for parameterized containers - added tests for + this - the 'container' keyword will now accept an instance of + Bread::Board::Container instead of the name, this makes subclassing + easier - added tests for this + - Bread::Board::Container::Parameterized - added this module and tests + - Bread::Baord::Manual - moved, re-organizad and added too the docs that + were previously in Bread::Board.pm 0.11 2010-03-25 - * Much improved documentation. - * Fixed inc/ to include all used Module-Install extensions. + - Much improved documentation. + - Fixed inc/ to include all used Module-Install extensions. 0.10 2010-02-22 - * Bread::Board - - import strict and warnings into the caller - upon import (Florian Ragwitz) - - fixing the SYNOPSIS so that it will actually - run (thanks to zby for spotting this) - - * Bread::Board::ConstructorInjection - - Add a constructor_name parameter for classes using - MooseX::Traits or other things which need an alternately - named constructor. (Tomas Doran) + - Bread::Board - import strict and warnings into the caller upon import + (Florian Ragwitz) - fixing the SYNOPSIS so that it will actually run + (thanks to zby for spotting this) + - Bread::Board::ConstructorInjection - Add a constructor_name parameter + for classes using MooseX::Traits or other things which need an + alternately named constructor. (Tomas Doran) 0.09 2009-07-29 - Add cloning support for containers and services - (thanks to jrockway for this) - - adding tests for this - - * Bread::Board::ConstructorInjection - - use meta->constructor_name instead of "new" - if possible (jrockway) - - * Bread::Board::Service::WithParameters - - fixing a leak where we would hold onto - parameters that were passed into get() + - Add cloning support for containers and services + - (thanks to jrockway for this) - adding tests for this + - Bread::Board::ConstructorInjection - use meta->constructor_name instead + of "new" if possible (jrockway) + - Bread::Board::Service::WithParameters - fixing a leak where we would + hold onto parameters that were passed into get() 0.08 2009-07-18 - - updating dates on all files - - * Bread::Board::LifeCycle::Singleton::WithParameters - - new module added to support the idea of a singleton - lifecycle keyed on the parameters rather then just - a per-instance item. - - * Bread::Board::Traversable - - fixed the is_weak_ref mis-spelling + - updating dates on all files + - Bread::Board::LifeCycle::Singleton::WithParameters - new module added + to support the idea of a singleton lifecycle keyed on the parameters + rather then just a per-instance item. + - Bread::Board::Traversable - fixed the is_weak_ref mis-spelling 0.07 2009-02-18 - - Work with new MooseX::Params::Validate - - Specify MX::P::Validate version number in Makefile.PL + - Work with new MooseX::Params::Validate + - Specify MX::P::Validate version number in Makefile.PL 0.06 2008-11-03 - - Forgot to update MANIFEST before uploading to CPAN. + - Forgot to update MANIFEST before uploading to CPAN. 0.05 2008-11-03 - - Applied immutablity to classes where applicable, and vigorously unimport - Moose keywords when they are no longer needed. This results in - x 2 performance as far as defining a Bread::Board model (Daisuke Maki). - - * Bread::Board - - Implemented unimport(), thus allowing you to remove keywords - exported by Bread::Board (Daisuke Maki). - - * Bread::Board::Traversable - - Unrolled recursive calls to loops, and removed Sub::Current dependency - (Daisuke Maki) + - Applied immutablity to classes where applicable, and vigorously + unimport Moose keywords when they are no longer needed. This results in + x 2 performance as far as defining a Bread::Board model (Daisuke Maki). + - Bread::Board - Implemented unimport(), thus allowing you to remove + keywords exported by Bread::Board (Daisuke Maki). + - Bread::Board::Traversable - Unrolled recursive calls to loops, and + removed Sub::Current dependency (Daisuke Maki) 0.04 2008-10-31 - * Bread::Board - Bread::Board::Traversable - - fix root path handling (thanks to Daisuke Maki) - - added tests for this - - * Bread::Board::Dumper - - Simple utility for dumping containers - (thanks to Daisuke Maki) - - * t/ - - fixing the plans so that new versions of - Test::More stop complaining + - Bread::Board Bread::Board::Traversable - fix root path handling (thanks + to Daisuke Maki) - added tests for this + - Bread::Board::Dumper - Simple utility for dumping containers (thanks to + Daisuke Maki) + - t/ - fixing the plans so that new versions of Test::More stop + complaining 0.03 2008-01-08 - * Bread::Board::Service::WithParameters - - fixed the parameter validation to - use a custom cache key, this is so - that it plays nicely with the new - MooseX::Params::Validate - - added tests for this + - Bread::Board::Service::WithParameters - fixed the parameter validation + to use a custom cache key, this is so that it plays nicely with the new + MooseX::Params::Validate - added tests for this 0.02 2008-01-08 - - forgot a dependency, whoops. + - forgot a dependency, whoops. 0.01 2008-01-07 - - Out with the old (IOC) and in with the new (Bread::Board) + - Out with the old (IOC) and in with the new (Bread::Board) diff -Nru libbread-board-perl-0.32/CODE_OF_CONDUCT.md libbread-board-perl-0.37/CODE_OF_CONDUCT.md --- libbread-board-perl-0.32/CODE_OF_CONDUCT.md 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/CODE_OF_CONDUCT.md 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, +religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at stevan@iinteractive.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + diff -Nru libbread-board-perl-0.32/CONTRIBUTORS libbread-board-perl-0.37/CONTRIBUTORS --- libbread-board-perl-0.32/CONTRIBUTORS 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/CONTRIBUTORS 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,35 @@ + +# BREAD-BOARD CONTRIBUTORS # + +This is the (likely incomplete) list of people who have helped +make this distribution what it is, either via code contributions, +patches, bug reports, help with troubleshooting, etc. A huge +'thank you' to all of them. + + * Alex Balhatchet + * André Walker + * ben hengst + * Brad Bowman + * Caleb Cushing + * Daisuke Maki + * Dave Rolsky + * Florian Ragwitz + * Gabor Szabo + * Gianni Ceccarelli + * Graham Knop + * Jason Galea + * Jason May + * Jay Hannah + * Jesse Luehrs + * Jonathan Rockway + * Kip Hampton + * Mohammad S Anwar + * Neil Bowers + * Philippe Bruhat (BooK) + * Sterling Hanenkamp + * Tomas Doran + * Yanick Champoux + * Yanick Champoux + * zdk + + diff -Nru libbread-board-perl-0.32/cpanfile libbread-board-perl-0.37/cpanfile --- libbread-board-perl-0.32/cpanfile 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/cpanfile 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,40 @@ +requires "Carp" => "0"; +requires "Module::Runtime" => "0"; +requires "Moose" => "0"; +requires "Moose::Exporter" => "2.1200"; +requires "Moose::Role" => "0"; +requires "Moose::Util" => "0"; +requires "Moose::Util::TypeConstraints" => "0"; +requires "MooseX::Clone" => "0.05"; +requires "MooseX::Params::Validate" => "0.14"; +requires "Scalar::Util" => "0"; +requires "Try::Tiny" => "0"; +requires "overload" => "0"; +requires "strict" => "0"; +requires "warnings" => "0"; + +on 'test' => sub { + requires "ExtUtils::MakeMaker" => "0"; + requires "File::Spec" => "0"; + requires "FindBin" => "0"; + requires "IO::Handle" => "0"; + requires "IPC::Open3" => "0"; + requires "Test::Fatal" => "0"; + requires "Test::Moose" => "0"; + requires "Test::More" => "0"; + requires "Test::Requires" => "0"; + requires "perl" => "5.006"; +}; + +on 'test' => sub { + recommends "CPAN::Meta" => "2.120900"; +}; + +on 'configure' => sub { + requires "ExtUtils::MakeMaker" => "0"; +}; + +on 'develop' => sub { + requires "Test::More" => "0.96"; + requires "Test::Vars" => "0"; +}; diff -Nru libbread-board-perl-0.32/debian/changelog libbread-board-perl-0.37/debian/changelog --- libbread-board-perl-0.32/debian/changelog 2019-02-18 22:26:16.000000000 +0000 +++ libbread-board-perl-0.37/debian/changelog 2020-04-01 19:42:51.000000000 +0000 @@ -1,3 +1,21 @@ +libbread-board-perl (0.37-1) unstable; urgency=medium + + [ upstream ] + * new release(s) + + [ Nick Morrott ] + * fix grammar in long description + + [ Jonas Smedegaard ] + * use debhelper compatibility level 12 (not 9); + build-depend on debhelper-compat (not debhelper) + * declare compliance with Debian Policy 4.5.0 + * copyright: update coverage + * build-depend on libmoo-perl, + to improve test coverage + + -- Jonas Smedegaard Wed, 01 Apr 2020 21:42:51 +0200 + libbread-board-perl (0.32-2) unstable; urgency=medium [ Salvatore Bonaccorso ] diff -Nru libbread-board-perl-0.32/debian/compat libbread-board-perl-0.37/debian/compat --- libbread-board-perl-0.32/debian/compat 2019-02-18 22:23:50.000000000 +0000 +++ libbread-board-perl-0.37/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru libbread-board-perl-0.32/debian/control libbread-board-perl-0.37/debian/control --- libbread-board-perl-0.32/debian/control 2019-02-18 22:22:54.000000000 +0000 +++ libbread-board-perl-0.37/debian/control 2020-04-01 19:41:55.000000000 +0000 @@ -2,9 +2,10 @@ Section: perl Priority: optional Build-Depends: - debhelper, + debhelper-compat (= 12), liblog-dispatch-perl , libmodule-runtime-perl , + libmoo-perl , libmoose-perl , libmoosex-clone-perl , libmoosex-params-validate-perl , @@ -15,7 +16,7 @@ Maintainer: Debian Perl Group Uploaders: Jonas Smedegaard , -Standards-Version: 4.3.0 +Standards-Version: 4.5.0 Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libbread-board-perl.git Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libbread-board-perl Homepage: https://github.com/stevan/BreadBoard @@ -35,6 +36,6 @@ Description: solderless way to wire up your application components Bread::Board is an inversion of control framework with a focus on dependency injection and lifecycle management. - It's goal is to help you write more decoupled objects and components + Its goal is to help you write more decoupled objects and components by removing the need for you to manually wire those objects/components together. diff -Nru libbread-board-perl-0.32/debian/copyright libbread-board-perl-0.37/debian/copyright --- libbread-board-perl-0.32/debian/copyright 2019-02-18 22:25:26.000000000 +0000 +++ libbread-board-perl-0.37/debian/copyright 2020-04-01 19:37:37.000000000 +0000 @@ -5,7 +5,7 @@ https://github.com/stevan/BreadBoard.git Files: * -Copyright: 2014, Infinity Interactive, Inc. +Copyright: 2009,2011,2013-2017,2019, Infinity Interactive, Inc. License-Grant: This is free software; you can redistribute it and/or modify it @@ -16,7 +16,7 @@ or the GNU General Public License version 1 or later. Files: debian/* -Copyright: 2013-2014,2016-2019, Jonas Smedegaard +Copyright: 2013-2014,2016-2019-2020, Jonas Smedegaard License-Grant: This program is free software; you can redistribute it and/or modify it diff -Nru libbread-board-perl-0.32/debian/copyright_hints libbread-board-perl-0.37/debian/copyright_hints --- libbread-board-perl-0.32/debian/copyright_hints 2019-02-18 22:25:44.000000000 +0000 +++ libbread-board-perl-0.37/debian/copyright_hints 2020-04-01 19:37:06.000000000 +0000 @@ -4,17 +4,22 @@ Source: FIXME Disclaimer: Autogenerated by CDBS -Files: Changes +Files: CODE_OF_CONDUCT.md + Changes + INSTALL MANIFEST + META.json Makefile.PL - debian/compat + SIGNATURE + cpanfile debian/control debian/gbp.conf debian/rules debian/source/format debian/watch - dist.ini t/00-compile.t + t/00-report-prereqs.dd + t/00-report-prereqs.t t/001_constructor_injection.t t/002_setter_injection.t t/003_block_injection.t @@ -78,19 +83,18 @@ t/300_no_new.t t/301_sugar.t t/302_path_traversal_deprecation.t + t/310_literal_keyword.t + t/500-gh61.t t/lib/bad.bb t/lib/false.bb t/lib/logger.bb t/lib/my_app.bb - xt/release/eol.t - xt/release/no-tabs.t - xt/release/pod-coverage.t - xt/release/pod-syntax.t + xt/release/unused-vars.t Copyright: NONE License: UNKNOWN FIXME -Files: README +Files: README.mkdn lib/Bread/Board.pm lib/Bread/Board/BlockInjection.pm lib/Bread/Board/ConstructorInjection.pm @@ -116,12 +120,13 @@ lib/Bread/Board/Service/Deferred/Thunk.pm lib/Bread/Board/Service/Inferred.pm lib/Bread/Board/Service/WithClass.pm + lib/Bread/Board/Service/WithConstructor.pm lib/Bread/Board/Service/WithDependencies.pm lib/Bread/Board/Service/WithParameters.pm lib/Bread/Board/SetterInjection.pm lib/Bread/Board/Traversable.pm lib/Bread/Board/Types.pm -Copyright: 2014, Infinity Interactive. +Copyright: 2009, 2011, 2013-2017, 2019, Infinity Interactive. License: Artistic or GPL-1+ FIXME @@ -129,13 +134,13 @@ Copyright: 1989, Free Software Foundation, Inc. 19xx name of author 19yy - 2014, Infinity Interactive. + 2009, 2011, 2013-2017, 2019, Infinity Interactive. disclaimer" for the program, if ed by the Free interest in the of this Package, but belong to whomever generated them, and may be sold the software, and -License: Artistic or GPL-1+ +License: Artistic or GPL-1+ and/or Artistic-1.0 and/or GPL-1 FIXME Files: debian/copyright-check @@ -154,8 +159,8 @@ License: UNKNOWN FIXME -Files: META.json -Copyright: Walker ", +Files: CONTRIBUTORS +Copyright: Walker License: UNKNOWN FIXME @@ -164,3 +169,8 @@ License: UNKNOWN FIXME +Files: doap.xml +Copyright: Walker +License: UNKNOWN + FIXME + diff -Nru libbread-board-perl-0.32/dist.ini libbread-board-perl-0.37/dist.ini --- libbread-board-perl-0.32/dist.ini 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/dist.ini 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -name = Bread-Board -author = Stevan Little -license = Perl_5 -copyright_holder = Infinity Interactive - -[@DOY] -:version = 0.14 -dist = Bread-Board -repository = github -github_user = stevan -github_name = BreadBoard -authority = cpan:STEVAN - -[AutoPrereqs] -skip = ^(?:Foo|Bar|Baz|My)\b -skip = ^(?:Chair|Desk|Employee|Thing)\b -skip = Logger::Role -skip = MyCustomWithParametersService -skip = WorkArea - -[ContributorsFromGit] - -[Prereqs / DevelopRequires] -; Form::Sensible = 0.11220 diff -Nru libbread-board-perl-0.32/doap.xml libbread-board-perl-0.37/doap.xml --- libbread-board-perl-0.32/doap.xml 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/doap.xml 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,394 @@ + + + Bread-Board + A solderless way to wire up your application components + + + Stevan Little + + + + + + Alex Balhatchet + + + + + + André Walker + + + + + + ben hengst + + + + + + Brad Bowman + + + + + + Caleb Cushing + + + + + + Daisuke Maki + + + + + + Dave Rolsky + + + + + + Florian Ragwitz + + + + + + Gabor Szabo + + + + + + Gianni Ceccarelli + + + + + + Graham Knop + + + + + + Jason Galea + + + + + + Jason May + + + + + + Jay Hannah + + + + + + Jesse Luehrs + + + + + + Jonathan Rockway + + + + + + Kip Hampton + + + + + + Mohammad S Anwar + + + + + + Neil Bowers + + + + + + Philippe Bruhat + BooK + + + + + + Sterling Hanenkamp + + + + + + Tomas Doran + + + + + + Yanick Champoux + + + + + + Yanick Champoux + + + + + + zdk + + + + + + + + + + + + + + + 0.01 + 2008-01-07 + + + + + 0.02 + 2008-01-08 + + + + + 0.03 + 2008-01-08 + + + + + 0.04 + 2008-10-31 + + + + + 0.05 + 2008-11-03 + + + + + 0.06 + 2008-11-03 + + + + + 0.07 + 2009-02-18 + + + + + 0.08 + 2009-07-18 + + + + + 0.09 + 2009-07-29 + + + + + 0.10 + 2010-02-22 + + + + + 0.11 + 2010-03-25 + + + + + 0.12 + 2010-04-18 + + + + + 0.13 + 2010-04-23 + + + + + 0.14 + 2010-08-24 + + + + + 0.15 + 2010-09-30 + + + + + 0.16 + 2011-01-10 + + + + + 0.17 + 2011-02-22 + + + + + 0.18 + 2011-04-13 + + + + + 0.19 + 2011-06-01 + + + + + 0.20 + 2011-06-13 + + + + + 0.21 + 2011-09-06 + + + + + 0.22 + 2011-10-03 + + + + + 0.23 + 2011-10-14 + + + + + 0.24 + 2011-10-15 + + + + + 0.25 + 2011-10-20 + + + + + 0.26 + 2013-08-01 + + + + + 0.27 + 2013-08-06 + + + + + 0.28 + 2013-08-30 + + + + + 0.29 + 2013-11-21 + + + + + 0.30 + 2014-02-02 + + + + + 0.31 + 2014-05-08 + + + + + 0.32 + 2014-06-03 + + + + + 0.33 + 2015-04-26 + + + + + 0.34 + 2016-03-28 + + + + + 0.35 + 2017-07-31 + + + + + 0.36 + 2017-10-15 + + + Perl + diff -Nru libbread-board-perl-0.32/INSTALL libbread-board-perl-0.37/INSTALL --- libbread-board-perl-0.32/INSTALL 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/INSTALL 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,43 @@ +This is the Perl distribution Bread-Board. + +Installing Bread-Board is straightforward. + +## Installation with cpanm + +If you have cpanm, you only need one line: + + % cpanm Bread::Board + +If you are installing into a system-wide directory, you may need to pass the +"-S" flag to cpanm, which uses sudo to install the module: + + % cpanm -S Bread::Board + +## Installing with the CPAN shell + +Alternatively, if your CPAN shell is set up, you should just be able to do: + + % cpan Bread::Board + +## Manual installation + +As a last resort, you can manually install it. Download the tarball, untar it, +then build it: + + % perl Makefile.PL + % make && make test + +Then install it: + + % make install + +If you are installing into a system-wide directory, you may need to run: + + % sudo make install + +## Documentation + +Bread-Board documentation is available as POD. +You can run perldoc from a shell to read the documentation: + + % perldoc Bread::Board diff -Nru libbread-board-perl-0.32/lib/Bread/Board/BlockInjection.pm libbread-board-perl-0.37/lib/Bread/Board/BlockInjection.pm --- libbread-board-perl-0.32/lib/Bread/Board/BlockInjection.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/BlockInjection.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::BlockInjection; -BEGIN { - $Bread::Board::BlockInjection::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::BlockInjection::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: service instantiated via custom subroutine +$Bread::Board::BlockInjection::VERSION = '0.37'; use Moose; with 'Bread::Board::Service::WithParameters', @@ -33,43 +32,64 @@ =head1 NAME -Bread::Board::BlockInjection +Bread::Board::BlockInjection - service instantiated via custom subroutine =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION -=head1 METHODS +This L class instantiates objects by +calling a coderef supplied in the L attribute. -=over 4 +This class consumes L, +L, +L. -=item B +=head1 ATTRIBUTES -=item B +=head2 C -=item B +A coderef, required. Will be invoked as a method on the service +object, so it can call L<<< C<< $_[0]->params +>>|Bread::Board::Service/params >>> to access parameters and (resolved) +dependencies. It should return an instance of L. -=item B +=head2 C -=item B +Attribute provided by L; if it is +set, L should return an instance of this class (and the class +will be already loaded, so there's no need to C it). -=back +=head1 METHODS -=head1 BUGS +=head2 C + +Predicate for L. If the service does not declare a class, the +L can of course return whatever it wants. -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. +=head2 C + +Calls the L as a method on the service, and returns whatever +that returned. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/ConstructorInjection.pm libbread-board-perl-0.37/lib/Bread/Board/ConstructorInjection.pm --- libbread-board-perl-0.32/lib/Bread/Board/ConstructorInjection.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/ConstructorInjection.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,33 +1,19 @@ package Bread::Board::ConstructorInjection; -BEGIN { - $Bread::Board::ConstructorInjection::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::ConstructorInjection::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: service instantiating objects via a constructor +$Bread::Board::ConstructorInjection::VERSION = '0.37'; use Moose; use Try::Tiny; use Bread::Board::Types; -with 'Bread::Board::Service::WithClass', +with 'Bread::Board::Service::WithConstructor', 'Bread::Board::Service::WithParameters', 'Bread::Board::Service::WithDependencies'; -has 'constructor_name' => ( - is => 'rw', - isa => 'Str', - lazy => 1, - builder => '_build_constructor_name', -); - has '+class' => (required => 1); -sub _build_constructor_name { - my $self = shift; - - try { Class::MOP::class_of($self->class)->constructor_name } || 'new'; -} - sub get { my $self = shift; @@ -47,35 +33,62 @@ =head1 NAME -Bread::Board::ConstructorInjection +Bread::Board::ConstructorInjection - service instantiating objects via a constructor =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION -=head1 METHODS +This L class instantiates objects by +calling the constructor on a class. -=over 4 +This class consumes L, +L, +L. -=item B +=head1 ATTRIBUTES -=back +=head2 C -=head1 BUGS +Attribute provided by L. This +service makes it a required attribute: you can't call a constructor if +you don't have a class. + +=head2 C -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. +Optional string, indicates the name of the class method to invoke to +construct the object. If not provided, defaults to the constructor +name obtained via L, or C if introspection +does not work. + +=head1 METHODS + +=head2 C + +Calls the constructor (as indicated by L) on the +L, passing all the L as a B. Returns +whatever the constructor returned (hopefully a correctly-constructed +object of the right class). =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Container/FromParameterized.pm libbread-board-perl-0.37/lib/Bread/Board/Container/FromParameterized.pm --- libbread-board-perl-0.32/lib/Bread/Board/Container/FromParameterized.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Container/FromParameterized.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Container::FromParameterized; -BEGIN { - $Bread::Board::Container::FromParameterized::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Container::FromParameterized::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: container with weak parent reference +$Bread::Board::Container::FromParameterized::VERSION = '0.37'; use Moose; extends 'Bread::Board::Container'; @@ -23,19 +22,38 @@ =head1 NAME -Bread::Board::Container::FromParameterized +Bread::Board::Container::FromParameterized - container with weak parent reference =head1 VERSION -version 0.32 +version 0.37 + +=head1 DESCRIPTION + +When L an actual container from a L, the returned +container is re-blessed into this class. + +The only difference between this class and L +is that the C attribute here is a weak reference. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Container/Parameterized.pm libbread-board-perl-0.37/lib/Bread/Board/Container/Parameterized.pm --- libbread-board-perl-0.32/lib/Bread/Board/Container/Parameterized.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Container/Parameterized.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,6 @@ package Bread::Board::Container::Parameterized; -BEGIN { - $Bread::Board::Container::Parameterized::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Container::Parameterized::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +$Bread::Board::Container::Parameterized::VERSION = '0.37'; use Moose; use Moose::Util 'find_meta'; use Bread::Board::Container::FromParameterized; @@ -35,12 +33,14 @@ has_service get_service_list has_services + services add_sub_container get_sub_container has_sub_container get_sub_container_list has_sub_containers + sub_containers ]] ); @@ -114,49 +114,101 @@ =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION +This class implements a sort of container factory for L: +a parameterized container is a, in practice, a function from a set of +parameters (which must be containers) to an actual container. See +L for an example. + =head1 ATTRIBUTES -=over 4 +=head2 C + +Read/write string, required. Every container needs a name, by which it +can be referenced when L. -=item B +=head2 C -=item B +Read-only arrayref of strings, required. These are the names of the +containers that must be passed to L<< C|create ( %params ) >> +to get an actual container out of this parameterized object. -=item B +=head2 C -=back +This attribute holds the "prototype" container. Services inside it can +depend on service paths that include the container names given in +L. =head1 METHODS -=over 4 +=head2 C -=item B +=head2 C -=item B -=item B +=head2 C -These two methods die, they are not appropriate, but are here for -completeness. +=head2 C -=back +=head2 C -=head1 BUGS +=head2 C + +=head2 C + +=head2 C + +=head2 C + +=head2 C + +All these methods are delegated to the "prototype" L, so +that this object can be defined as if it were a normal container. + +=head2 C -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. + my $container = $parameterized_container->create(%params); + +After checking that the keys of C<%params> are exactly the same +strings that are present in L, this method +clones the prototype L, adds the C<%params> to the clone +as sub-containers, and returns the clone. + +If this was not a top-level container, the parent is also cloned, and +the container clone is added to the parent clone. + +Please note that the container returned by this method does I +have the same name as the parameterized container, and that calling +this method with different parameter values will return different +containers, but all with the same name. It's probably a bad idea to +instantiate a non-top-level parameterized container more than once. + +=head2 C + +=head2 C + +These two methods die, since services in a parameterized container +won't usually resolve, and attempting to do so is almost always a +mistake. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Container.pm libbread-board-perl-0.37/lib/Bread/Board/Container.pm --- libbread-board-perl-0.32/lib/Bread/Board/Container.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Container.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Container; -BEGIN { - $Bread::Board::Container::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Container::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: A container for services and other containers +$Bread::Board::Container::VERSION = '0.37'; use Moose; use Moose::Util::TypeConstraints 'find_type_constraint'; use MooseX::Params::Validate 0.14; @@ -193,69 +192,238 @@ =head1 NAME -Bread::Board::Container +Bread::Board::Container - A container for services and other containers =head1 VERSION -version 0.32 +version 0.37 + +=head1 SYNOPSIS + + use Bread::Board; + my $c = container MCP => as { + container Users => as { + service flynn => ...; + service bradley => ...; + service dillinger => ...; + }; + + container Programs => as { + container Rebels => as { + service tron => ...; + service yori => ...; + alias flynn => '/Users/flynn'; + }; + + # nested container + container Slaves => as { + service sark => ...; + service crom => ...; + }; + }; + }; + + # OR directly... + my $guardians => Bread::Board::Container->new( name => 'Guardians' ); + $guardians->add_service( + Bread::Board::ConstructorInjection->new( + name => 'dumont', + ..., + ) + ); + $c->get_sub_container('Programs')->add_sub_container($guardians); =head1 DESCRIPTION +This class implements the container for L: a container +is a thing that contains services and other containers. Each container +and service has a name, so you end up with a tree of named nodes, just +like files and directories in a filesystem: each item can be +referenced using a path (see L for the +details). + +=head1 ATTRIBUTES + +=head2 C + +Read/write string, required. Every container needs a name, by which it +can be referenced when L. + +=head2 C + +Hashref, constrained by L<< +C|Bread::Board::Types/Bread::Board::Container::ServiceList +>>, mapping names to services directly contained in this +container. Every service added here will have its L<< +C|Bread::Board::Traversable/parent >> set to this container. + +You can pass an arrayref of services instead of a hashref, the keys +will be the names of the services. + +You should probably use L and L to +manipulate this attribute, instead of modifying it directly. + +=head2 C + +Hashref, constrained by L<< +C|Bread::Board::Types/Bread::Board::Container::SubContainerList +>>, mapping names to containers directly contained in this +container. Every container added here will have its L<< +C|Bread::Board::Traversable/parent >> set to this container. + +You can pass an arrayref of containers instead of a hashref, the keys +will be the names of the containers. + +You should probably use L and +L to manipulate this attribute, instead of +modifying it directly. + +Containers added here can either be normal L +or L. + =head1 METHODS -=over 4 +=head2 C -=item B + $container->add_service($service); -=item B +Adds a service into the L map, using its name as the key. -=item B +=head2 C -=item B + my $service = $container->get_service($name); -=item B +Returns a service by name, or C if there's no such service in +the L map. -=item B +=head2 C -=item B + if ($container->has_service($name)) { ... } -=item B +Returns true if a service with the given name name exists in the +L map, false otherwise. -=item B +=head2 C -=item B + if ($container->has_services) { ... } -=item B +Returns true if the L map contains any services, false if +it's empty. -=item B +=head2 C -=item B + my @service_names = $container->get_service_list(); -=item B +Returns the names off all services present in the L map. -=item B $service_name, ?type => $type, ?parameters => { ... } )> +=head2 C -=item B + $container->add_sub_container($container); -=item B +Adds a container into the L map, using its name as +the key. -=item B +=head2 C -=back + my $container = $container->get_sub_container($name); -=head1 BUGS +Returns a container by name, or C if there's no such container +in the L map. + +=head2 C + + if ($container->has_sub_container($name)) { ... } + +Returns true if a container with the given name name exists in the +L map, false otherwise. + +=head2 C + + if ($container->has_sub_containers) { ... } + +Returns true if the L map contains any contains, +false if it's empty. + +=head2 C -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. + my @container_names = $container->get_sub_container_list(); + +Returns the names off all containers present in the L +map. + +=head2 C + + $containers->add_type_mapping_for( $type_name, $service ); + +Adds a mapping from a L to a +service: whenever we try to L that type, +we'll use that service to instantiate it. + +=head2 C + + my $service = $container->get_type_mapping_for( $type_name ); + +Returns the service to use to instantiate the given type name. + +Important: if a mapping for the exact type can't be found, but a +mapping for a I of it can, you'll get the latter instead: + + package Superclass { use Moose }; + package Subclass { use Moose; exends 'Superclass' }; + + $c->add_type_mapping_for( + 'Subclass', + Bread::Board::ConstructorInjection->new(name=>'sc',class=>'Subclass'), + ); + my $o = $c->get_type_mapping_for('Superclass')->get; + +C<$o> is an instance of C. If there are more than one +sub-type mapped, you get a random one. This is probably a bad idea. + +=head2 C + + if ($container->has_type_mapping_for( $type_name )) { ... } + +Returns true if we have a service defined to instantiate the given +type name, but see the note on +L about +subtype mapping. + +=head2 C + + my $object = $container->resolve(service=>$service_name); + my $object = $container->resolve(service=>$service_name,parameters=>\%p); + +When given a service name, this method will +L the service, then call L<< +C|Bread::Board::Service/get >> on it, optionally passing the +given parameters. + + my $object = $container->resolve(type=>$type); + my $object = $container->resolve(type=>$type,parameters=>\%p); + +When given a type name, this method will use +L to get +the service, then call L<< C|Bread::Board::Service/get >> on it, +optionally passing the given parameters. If the instance is not of the +expected type, the method will die. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Dependency.pm libbread-board-perl-0.37/lib/Bread/Board/Dependency.pm --- libbread-board-perl-0.32/lib/Bread/Board/Dependency.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Dependency.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Dependency; -BEGIN { - $Bread::Board::Dependency::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Dependency::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: dependency for a service +$Bread::Board::Dependency::VERSION = '0.37'; use Moose; use Bread::Board::Service; @@ -58,49 +57,72 @@ =head1 NAME -Bread::Board::Dependency +Bread::Board::Dependency - dependency for a service =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION -=head1 METHODS +This class holds the information for a dependency of a +L. When L, +instances of this class will be used to access the services that will +provide the depended-on values. -=over 4 +This class consumes the L role to retrieve +services given their path. -=item B +=head1 ATTRIBUTES -=item B +=head2 C -=item B +The path to use (possibly relative to the dependency itself) to access +the L. -=item B +=head2 C -=item B +The service this dependency points at. Usually built lazily from the +L, but could just be passed in to the constructor. -=item B +=head2 C -=item B +Name of the L, defaults to the last element of the +L. -=item B +=head1 METHODS -=back +=head2 C -=head1 BUGS +Predicate for the L attribute. + +=head2 C + +=head2 C + +=head2 C -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. +=head2 C + +These methods are delegated to the L. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Dumper.pm libbread-board-perl-0.37/lib/Bread/Board/Dumper.pm --- libbread-board-perl-0.32/lib/Bread/Board/Dumper.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Dumper.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Dumper; -BEGIN { - $Bread::Board::Dumper::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Dumper::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: Pretty printer for visualizing the layout of your Bread::Board +$Bread::Board::Dumper::VERSION = '0.37'; use Moose; sub dump { @@ -19,23 +18,39 @@ $output .= join('', $indent, "service: ", $thing->name, "\n" ); if ($thing->does('Bread::Board::Service::WithDependencies')) { - while (my($key, $value) = each %{ $thing->dependencies }) { - $output .= $self->dump($value, $indent); + my $deps = $thing->dependencies; + for my $key (sort keys %{$deps}) { + $output .= $self->dump($deps->{$key}, $indent); } } } elsif ($thing->isa('Bread::Board::Container')) { $output = join('', $indent, "container: ", $thing->name, "\n" ); - my ($key, $value); + $output .= $self->_dump_container($thing, $indent); + } + elsif ($thing->isa('Bread::Board::Container::Parameterized')) { + my $params = join ', ', @{ $thing->allowed_parameter_names }; + $output = join('', $indent, "container: ", $thing->name, " [$params]\n" ); + $output .= $self->_dump_container($thing, $indent); + } - while (($key, $value) = each %{ $thing->sub_containers }) { - $output .= $self->dump($value, $indent); - } + return $output; +} - while (($key, $value) = each %{ $thing->services }) { - $output .= $self->dump($value, $indent); - } +sub _dump_container { + my ($self, $c, $indent) = @_; + + my $output = ''; + + my $subs = $c->sub_containers; + for my $key (sort keys %{$subs}) { + $output .= $self->dump($subs->{$key}, $indent); + } + + my $services = $c->services; + for my $key (sort keys %{$services}) { + $output .= $self->dump($services->{$key}, $indent); } return $output; @@ -53,11 +68,11 @@ =head1 NAME -Bread::Board::Dumper +Bread::Board::Dumper - Pretty printer for visualizing the layout of your Bread::Board =head1 VERSION -version 0.32 +version 0.37 =head1 SYNOPSIS @@ -86,19 +101,22 @@ Daisuke Maki -=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 +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/LifeCycle/Singleton/WithParameters.pm libbread-board-perl-0.37/lib/Bread/Board/LifeCycle/Singleton/WithParameters.pm --- libbread-board-perl-0.32/lib/Bread/Board/LifeCycle/Singleton/WithParameters.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/LifeCycle/Singleton/WithParameters.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::LifeCycle::Singleton::WithParameters; -BEGIN { - $Bread::Board::LifeCycle::Singleton::WithParameters::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::LifeCycle::Singleton::WithParameters::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: singleton lifecycle role for a parameterized service +$Bread::Board::LifeCycle::Singleton::WithParameters::VERSION = '0.37'; use Moose::Role; with 'Bread::Board::LifeCycle'; @@ -58,43 +57,59 @@ =head1 NAME -Bread::Board::LifeCycle::Singleton::WithParameters +Bread::Board::LifeCycle::Singleton::WithParameters - singleton lifecycle role for a parameterized service =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION -=head1 METHODS +Sub-role of L, this role defines the +"singleton" lifecycle for a parameterized service. The C method +will only do its work the first time it is invoked for each set of +parameters; subsequent invocations with the same parameters will +return the same object. -=over 4 +=head1 ATTRIBUTES -=item B +=head2 C -=item B +Hashref mapping keys to objects, used to cache the results of L -=item B +=head1 METHODS -=item B +=head2 C -=item B +Generates a key using L (passing it all the +arguments); if the L attribute does not hold an object for +that key, it will build it (by calling the underlying C method) +and store it in L. The object (either retrieved from +L or freshly built) will be returned. + +=head2 C + +Generates a (hopefully) unique key from the given arguments (usually, +whatever was passed to L). The current implementation +stringifies all arguments, so different references to identical values +will be considered different. -=back +=head1 AUTHOR -=head1 BUGS +Stevan Little -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 BUGS -=head1 AUTHOR +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues -Stevan Little +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/LifeCycle/Singleton.pm libbread-board-perl-0.37/lib/Bread/Board/LifeCycle/Singleton.pm --- libbread-board-perl-0.32/lib/Bread/Board/LifeCycle/Singleton.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/LifeCycle/Singleton.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::LifeCycle::Singleton; -BEGIN { - $Bread::Board::LifeCycle::Singleton::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::LifeCycle::Singleton::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: service role for singleton lifecycle +$Bread::Board::LifeCycle::Singleton::VERSION = '0.37'; use Moose::Role; use Try::Tiny; @@ -68,41 +67,61 @@ =head1 NAME -Bread::Board::LifeCycle::Singleton +Bread::Board::LifeCycle::Singleton - service role for singleton lifecycle =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION -=head1 METHODS +Sub-role of L, this role defines the +"singleton" lifecycle for a service. The C method will only do +its work the first time it is invoked; subsequent invocations will +return the same object. -=over 4 +=head1 ATTRIBUTES -=item B +=head2 C -=item B +The object build by the last call to C to actually do any work, +and returned by any subsequent call to C. -=item B +=head1 METHODS -=item B +=head2 C -=back +The first time this is called (or the first time after calling +L), the actual C method will be invoked, and its +return value cached in the L attribute. The value of that +attribute will always be returned, so you can call C as many time +as you need, and always receive the same instance. -=head1 BUGS +=head2 C + +Predicate for the L attribute. + +=head2 C -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. +Clearer for the L attribute. Clearing the attribute will +cause the next call to C to instantiate a new object. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/LifeCycle.pm libbread-board-perl-0.37/lib/Bread/Board/LifeCycle.pm --- libbread-board-perl-0.32/lib/Bread/Board/LifeCycle.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/LifeCycle.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::LifeCycle; -BEGIN { - $Bread::Board::LifeCycle::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::LifeCycle::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: base lifecycle role +$Bread::Board::LifeCycle::VERSION = '0.37'; use Moose::Role; no Moose::Role; 1; @@ -15,31 +14,36 @@ =head1 NAME -Bread::Board::LifeCycle +Bread::Board::LifeCycle - base lifecycle role =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION -=head1 NAME - -Bread::Board::LifeCycle - -=head1 BUGS +This is an empty role. Roles that define L should consume this role. -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. +For an example, see L and +L. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Literal.pm libbread-board-perl-0.37/lib/Bread/Board/Literal.pm --- libbread-board-perl-0.32/lib/Bread/Board/Literal.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Literal.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,15 +1,13 @@ package Bread::Board::Literal; -BEGIN { - $Bread::Board::Literal::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Literal::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: service providing a literal value +$Bread::Board::Literal::VERSION = '0.37'; use Moose; with 'Bread::Board::Service'; has 'value' => ( is => 'rw', - isa => 'Defined', required => 1, ); @@ -31,39 +29,92 @@ =head1 NAME -Bread::Board::Literal +Bread::Board::Literal - service providing a literal value =head1 VERSION -version 0.32 +version 0.37 + +=head1 SYNOPSIS + + my $c = container PrettyBoring => as { + + # These are Bread::Board::Literal services + service connect_string => 'dbi:mysql:boring_db'; + service service_url => 'http://api.example.com/v0/boring'; + + # And some other services depending on them... + + service dbconn => ( + class => 'DBI', + block => sub { + my $s = shift; + DBI->new($s->param('connect_string'); + }, + dependencies => wire_names(qw( connect_string )), + ); + + service service_request => ( + class => 'HTTP::Request', + block => sub { + my $s = shift; + HTTP::Request->new(POST => $s->param('service_url')); + }, + dependencies => wire_names(qw( service_url )); + }; + }; + + # OR to use directly: + my $literal = Bread::Board::Literal->new( + name => 'the_answer_to_life_the_universe_and_everything', + value => 42, + ); + $c->add_service($literal); =head1 DESCRIPTION -=head1 METHODS +A literal service is one that stores a literal scalar or reference for use in +your Bread::Board. -=over 4 +Beware of using references in your literals as they may cause your Bread::Board +to leak memory. If this is a concern, you may want to weaken your references. -=item B +See L. -=item B +=head1 ATTRIBUTES -=item B +=head2 C -=back +Required attribute with read/write accessor. This is the value that +L will return. -=head1 BUGS +=head1 METHODS -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. +=head2 C + +Returns the L, unaltered. + +=head2 C + +Dies: a literal service is (essentially) a constant, it does not make +sense to inherit from it. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Manual/Concepts/Advanced.pod libbread-board-perl-0.37/lib/Bread/Board/Manual/Concepts/Advanced.pod --- libbread-board-perl-0.32/lib/Bread/Board/Manual/Concepts/Advanced.pod 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Manual/Concepts/Advanced.pod 2019-06-28 23:19:54.000000000 +0000 @@ -13,14 +13,14 @@ =head1 VERSION -version 0.32 +version 0.37 =head1 INTRODUCTION In the L document we attempted to explain the conceptual foundations of Bread::Board. In that we exposed you to the idea of a container and a service and showed how they -could be used. In that document we built a hierarchal container +could be used. In that document we built a hierarchical container which organized different sets of services into what could be seen as subsystems within an overall application. While this alone has plenty of value, you might be asking yourself, what about re-use? @@ -134,7 +134,7 @@ It is parameterized with a C container which has three services, a C, a C and a C. -Now let's create a simple container which fufills these +Now let's create a simple container which fulfills these requirements. my $db_conn_info = container 'DatabaseConnection' => as { @@ -208,9 +208,18 @@ Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Manual/Concepts/Typemap.pod libbread-board-perl-0.37/lib/Bread/Board/Manual/Concepts/Typemap.pod --- libbread-board-perl-0.32/lib/Bread/Board/Manual/Concepts/Typemap.pod 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Manual/Concepts/Typemap.pod 2019-06-28 23:19:54.000000000 +0000 @@ -13,7 +13,7 @@ =head1 VERSION -version 0.32 +version 0.37 =head1 INTRODUCTION @@ -109,7 +109,7 @@ For the C object, we saw the B type and then basically called C on the B object. We then saw the B and B objects and called C on those as well. -The result of this recursive inferrence was that the B, +The result of this recursive inference was that the B, B, B and B relationships were modeled in Bread::Board as dependent services. @@ -121,10 +121,10 @@ and get more information. However, this was not the case with the I and I attributes of the B object. In that case, we determined that we couldn't resolve those objects and -(because it was a top-level inferrence) instead turned them into required +(because it was a top-level inference) instead turned them into required parameters for the inferred B service. -And lastly, with a top-level inferrence (not one caused by recursion) +And lastly, with a top-level inference (not one caused by recursion) Bread::Board will also look at all the remaining non-required attributes and turn them into optional parameters. In this case we have a C attribute that is not required and so is listed as an optional parameter, @@ -145,9 +145,18 @@ Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Manual/Concepts.pod libbread-board-perl-0.37/lib/Bread/Board/Manual/Concepts.pod --- libbread-board-perl-0.32/lib/Bread/Board/Manual/Concepts.pod 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Manual/Concepts.pod 2019-06-28 23:19:54.000000000 +0000 @@ -13,7 +13,7 @@ =head1 VERSION -version 0.32 +version 0.37 =head1 INTRODUCTION @@ -323,14 +323,14 @@ =back -=head2 Hierarchal Containers +=head2 Hierarchical Containers Up until now, we have seen basic containers which only have a single level of components. As your application grows larger it may become -useful to have a more hierarchal approach to your containers. +useful to have a more hierarchical approach to your containers. Bread::Board::Container supports this behavior through its many -subcontainer methods. Here is an example of how we might re-arrange -the previous examples using subcontainers. +sub-container methods. Here is an example of how we might re-arrange +the previous examples using sub-containers. my $app_c = Bread::Board::Container->new( name => 'app' ); @@ -422,7 +422,7 @@ ) ); -So, as an example that can be seen above, hierarchal containers can be used as a +So, as an example that can be seen above, hierarchical containers can be used as a form of namespacing to organize your Bread::Board configuration better. As it is shown with the 'authenticator' service, it is possible to address services outside of your container @@ -504,9 +504,18 @@ Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Manual/Example/FormSensible.pod libbread-board-perl-0.37/lib/Bread/Board/Manual/Example/FormSensible.pod --- libbread-board-perl-0.32/lib/Bread/Board/Manual/Example/FormSensible.pod 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Manual/Example/FormSensible.pod 2019-06-28 23:19:54.000000000 +0000 @@ -13,7 +13,7 @@ =head1 VERSION -version 0.32 +version 0.37 =head1 SYNOPSIS @@ -161,7 +161,7 @@ of subclassing of the Container objects. Jay also asked about passing in the Catalyst model into the fields so -that he could populate something like a select pulldown menu. Again I +that he could populate something like a select pull-down menu. Again I used parameterized modules, in this case we parameterized the FooFields container with a Model container which had a schema service (which was a DBIx::Class schema object). @@ -185,9 +185,18 @@ Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Manual/Example/LogDispatch.pod libbread-board-perl-0.37/lib/Bread/Board/Manual/Example/LogDispatch.pod --- libbread-board-perl-0.32/lib/Bread/Board/Manual/Example/LogDispatch.pod 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Manual/Example/LogDispatch.pod 2019-06-28 23:19:54.000000000 +0000 @@ -13,7 +13,7 @@ =head1 VERSION -version 0.32 +version 0.37 =head1 SYNOPSIS @@ -75,9 +75,9 @@ This example can be made even more dynamic if you build the 'Logging' component as a parameterized container whose parameter -is the 'Ouputs' container. Here is what that would look like. +is the 'Outputs' container. Here is what that would look like. - my $logging = container 'Logging' => [ 'Outputs' ] as { + my $logging = container 'Logging' => [ 'Outputs' ] => as { service 'Logger' => ( block => sub { my $s = shift; @@ -127,9 +127,18 @@ Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Manual/Example.pod libbread-board-perl-0.37/lib/Bread/Board/Manual/Example.pod --- libbread-board-perl-0.32/lib/Bread/Board/Manual/Example.pod 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Manual/Example.pod 2019-06-28 23:19:54.000000000 +0000 @@ -13,7 +13,7 @@ =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION @@ -43,9 +43,18 @@ Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Manual.pod libbread-board-perl-0.37/lib/Bread/Board/Manual.pod --- libbread-board-perl-0.32/lib/Bread/Board/Manual.pod 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Manual.pod 2019-06-28 23:19:54.000000000 +0000 @@ -13,7 +13,7 @@ =head1 VERSION -version 0.32 +version 0.37 =head1 INTRODUCTION @@ -92,9 +92,18 @@ Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Service/Alias.pm libbread-board-perl-0.37/lib/Bread/Board/Service/Alias.pm --- libbread-board-perl-0.32/lib/Bread/Board/Service/Alias.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Service/Alias.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Service::Alias; -BEGIN { - $Bread::Board::Service::Alias::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Service::Alias::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: aliases another service +$Bread::Board::Service::Alias::VERSION = '0.37'; use Moose; use Try::Tiny; @@ -49,33 +48,47 @@ =head1 NAME -Bread::Board::Service::Alias +Bread::Board::Service::Alias - aliases another service =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION -No user servicable parts. Read the source if you are interested. +This L class implements +L. -=head1 BUGS +=head1 ATTRIBUTES + +=head2 C + +Read-only string attribute, the path of the service this alias refers +to (it can be an alias itself) + +=head2 C -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. - -=for Pod::Coverage aliased_from_path -aliased_from -_build_aliased_from +Lazy read-only attribute, built by calling L<< +C|Bread::Board::Traversable/fetch >> on this service using the +L as path to fetch =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Service/Deferred/Thunk.pm libbread-board-perl-0.37/lib/Bread/Board/Service/Deferred/Thunk.pm --- libbread-board-perl-0.32/lib/Bread/Board/Service/Deferred/Thunk.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Service/Deferred/Thunk.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Service::Deferred::Thunk; -BEGIN { - $Bread::Board::Service::Deferred::Thunk::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Service::Deferred::Thunk::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: Helper for using services with incomplete parameters +$Bread::Board::Service::Deferred::Thunk::VERSION = '0.37'; use Moose; has 'thunk' => ( @@ -25,29 +24,48 @@ =head1 NAME -Bread::Board::Service::Deferred::Thunk +Bread::Board::Service::Deferred::Thunk - Helper for using services with incomplete parameters =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION -No user servicable parts. Read the source if you are interested. +This class is used when L. -=head1 BUGS +Since the service needs parameters to instantiate its value, and no +values were provided for those parameters, the best we can do is use a +coderef that will accept the parameters and call C on the +service. + +=head1 METHODS + +=head2 C + + my $service_value = $deferred_thunk->inflate(%service_parameters); -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. +This will call C on the service, passing it all the +C<%service_parameters>. Normal parameter validation and service +lifecycle apply. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Service/Deferred.pm libbread-board-perl-0.37/lib/Bread/Board/Service/Deferred.pm --- libbread-board-perl-0.32/lib/Bread/Board/Service/Deferred.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Service/Deferred.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Service::Deferred; -BEGIN { - $Bread::Board::Service::Deferred::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Service::Deferred::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: Helper for holding a service that is not quite constructed yet +$Bread::Board::Service::Deferred::VERSION = '0.37'; use Moose (); use overload @@ -92,34 +91,45 @@ =head1 NAME -Bread::Board::Service::Deferred +Bread::Board::Service::Deferred - Helper for holding a service that is not quite constructed yet =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION -No user servicable parts. Read the source if you are interested. +Class for proxy objects used when L. -=head1 BUGS +This class uses a few nasty tricks: replacing C<$_[0]>, using +C, overriding C C and C, heavy operator +overloading... you should probably not take inspiration from this code +unless you really know what you're doing. + +In practice, a variable containing an instance of +C will have its value changed to the +actual value instantiated by the service at the first opportunity, and +you should not notice that this class was ever there. -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. - -=for Pod::Coverage can -isa -meta -new +=for Pod::Coverage can isa meta new =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Service/Inferred.pm libbread-board-perl-0.37/lib/Bread/Board/Service/Inferred.pm --- libbread-board-perl-0.32/lib/Bread/Board/Service/Inferred.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Service/Inferred.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Service::Inferred; -BEGIN { - $Bread::Board::Service::Inferred::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Service::Inferred::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: Helper for inferring a service from a Moose object +$Bread::Board::Service::Inferred::VERSION = '0.37'; use Moose; use Moose::Util::TypeConstraints 'find_type_constraint'; @@ -221,11 +220,11 @@ =head1 NAME -Bread::Board::Service::Inferred +Bread::Board::Service::Inferred - Helper for inferring a service from a Moose object =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION @@ -235,25 +234,24 @@ =head1 METHODS -=over 4 +=head2 C -=item B +=head1 AUTHOR -=back +Stevan Little =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. +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues -=head1 AUTHOR - -Stevan Little +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Service/WithClass.pm libbread-board-perl-0.37/lib/Bread/Board/Service/WithClass.pm --- libbread-board-perl-0.32/lib/Bread/Board/Service/WithClass.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Service/WithClass.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Service::WithClass; -BEGIN { - $Bread::Board::Service::WithClass::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Service::WithClass::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: role for services returning instances of a given class +$Bread::Board::Service::WithClass::VERSION = '0.37'; use Moose::Role; use Module::Runtime (); @@ -32,37 +31,51 @@ =head1 NAME -Bread::Board::Service::WithClass +Bread::Board::Service::WithClass - role for services returning instances of a given class =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION -=head1 METHODS +This a sub-role of L for services that return +instances of a given class. -=over 4 +=head1 ATTRIBUTES -=item B +=head2 C -=item B +Read/write string attribute, the name of the class that this service +will probably instantiate. -=back +=head1 METHODS -=head1 BUGS +=head2 C + +Predicate for the L attribute, true if it has been set. + +=head2 C -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. +This role adds a C modifier to the C method, ensuring +that the module implementing the L is loaded. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Service/WithConstructor.pm libbread-board-perl-0.37/lib/Bread/Board/Service/WithConstructor.pm --- libbread-board-perl-0.32/lib/Bread/Board/Service/WithConstructor.pm 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Service/WithConstructor.pm 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,80 @@ +package Bread::Board::Service::WithConstructor; +our $AUTHORITY = 'cpan:STEVAN'; +$Bread::Board::Service::WithConstructor::VERSION = '0.37'; +use Moose::Role; + +use Try::Tiny; + +with 'Bread::Board::Service::WithClass'; + +has 'constructor_name' => ( + is => 'rw', + isa => 'Str', + lazy => 1, + builder => '_build_constructor_name', +); + +sub _build_constructor_name { + my $self = shift; + + # using Class::MOP::class_of on a Moo + # object causes mayhem, so we take care of that + # special case first. See GH#61 + try { $self->class->isa('Moo::Object') && 'new' } + || try { Class::MOP::class_of($self->class)->constructor_name } + || 'new'; +} + +no Moose; 1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Bread::Board::Service::WithConstructor + +=head1 VERSION + +version 0.37 + +=head1 DESCRIPTION + +=head1 METHODS + +=over 4 + +=item B + +=back + +=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 + +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. + +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 diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Service/WithDependencies.pm libbread-board-perl-0.37/lib/Bread/Board/Service/WithDependencies.pm --- libbread-board-perl-0.32/lib/Bread/Board/Service/WithDependencies.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Service/WithDependencies.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Service::WithDependencies; -BEGIN { - $Bread::Board::Service::WithDependencies::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Service::WithDependencies::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: Services with dependencies +$Bread::Board::Service::WithDependencies::VERSION = '0.37'; use Moose::Role; use Try::Tiny; @@ -112,49 +111,127 @@ =head1 NAME -Bread::Board::Service::WithDependencies +Bread::Board::Service::WithDependencies - Services with dependencies =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION +This is a sub-role of L, for services with +dependencies. It provides the mechanism to recursively resolve +dependencies. + +=head1 ATTRIBUTES + +=head2 C + +Hashref, constrained by L<< +C|Bread::Board::Types/Bread::Board::Service::Dependencies +>>. Values must be instances of L, but can +be coerced from various other types, see L. + =head1 METHODS -=over 4 +=head2 C -=item B + $service->add_dependency(name=>$dep); -=item B +Adds a new dependency. -=item B +=head2 C -=item B + my $dep = $service->get_dependency('name'); -=item B +Gets a dependency by name. -=item B +=head2 C -=item B + if ($service->has_dependency('name')) { ... } -=item B +Returns true if this service has a dependency with the given name. -=back +=head2 C -=head1 BUGS + if ($service->has_dependencies) { ... } + +Returns true if this service has any dependency. + +=head2 C + + my %deps = $service->get_all_dependencies; -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. +Returns all the dependencies for this service, as a key-value list. + +=head2 C + +Builder for the service parameters, augmented to inject all the +L into the L<< +C|Bread::Board::Service/params >> attribute, so that C +can use them. + +=head2 C + +I the C method, the L<< +C|Bread::Board::Service/params >> attribute is cleared, to +make sure that dependencies will be resolved again on the next call (of +course, if the service is using a L, the whole "getting" +only happens once). + +=head2 C + + my %name_object_map = $self->resolve_dependencies; + +For each element of L, calls its L<< +C|Bread::Board::Dependency/service >> method to retrieve the +service we're dependent on, then tries to instantiate the value of the +service. This can happen in a few different ways: + +=over 4 + +=item the service is not locked, and does not require any parameter + +just call C on it + +=item the service is not locked, requires parameters, but the dependency has values for them + +call C<< $service->get(%{$dependency->service_params}) >> + +=item the service is not locked, requires parameters, and we don't have values for them + +we can't instantiate anything at this point, so we use a +L instance, on which you can +call the C method, passing it all the needed parameters, to +get the actual instance + +=item the service is locked + +we return a L that will proxy to the +instance that the service will eventually return; yes, this means that +in many cases circular dependencies can be resolved, at the cost of a +proxy object + +=back =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Service/WithParameters.pm libbread-board-perl-0.37/lib/Bread/Board/Service/WithParameters.pm --- libbread-board-perl-0.32/lib/Bread/Board/Service/WithParameters.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Service/WithParameters.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Service::WithParameters; -BEGIN { - $Bread::Board::Service::WithParameters::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Service::WithParameters::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: Services with parameters +$Bread::Board::Service::WithParameters::VERSION = '0.37'; use Moose::Role; use MooseX::Params::Validate qw(validated_hash); @@ -82,45 +81,108 @@ =head1 NAME -Bread::Board::Service::WithParameters +Bread::Board::Service::WithParameters - Services with parameters =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION +This is a sub-role of L, for parameterized +services. These are services that will instantiate different values +depending on parameters that are passed to the C method. You can +pass those parameters via the L<< C attribute of +C|Bread::Board::Dependency/service_params +>>, or via the L<< C method of +C|Bread::Board::Service::Deferred::Thunk/inflate +>>. + +=head1 ATTRIBUTES + +=head2 C + +Read-only hashref, will be passed as-is to L<< +C's +C|MooseX::Params::Validate/validated_hash >>, so you +can use things like C and C in addition to type +constraints: + + service something => ( + class => 'Thing', + parameters => { + type => { isa => 'Str', default => 'text' }, + }, + ); + +This attribute uses coercions on L<< +C|Bread::Board::Types/Bread::Board::Service::Parameters +>> so that you can also say: + + service something => ( + class => 'Thing', + parameters => ['type'], + ); + +and it will be equivalent to: + + service something => ( + class => 'Thing', + parameters => { + type => { optional => 0 }, + }, + ); + =head1 METHODS -=over 4 +=head2 C -=item B +Predicate for the L attribute. -=item B +=head2 C -=item B +Returns true if any of the L have a C value. -=item B +=head2 C -=item B +Returns true if any of the L does I have C +set to true. -=item B +=head2 C -=back + my %parameters = $service->check_parameters(name1=>$value1,name2=>$value2); + my %parameters = $service->check_parameters({name1=>$value1,name2=>$value2}); -=head1 BUGS +If any L are defined, this function validates its +arguments against the parameters' definitions (using +L). It will die if the validation fails, or +return the validated parameters (including default value) if it +succeeds. + +=head2 C -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. +I the C method, arguments to C are passed through +L and added to the L<< +C|Bread::Board::Service/params >> hashref. I the C +method, those keys/values will be removed. In practice, this makes all +parameters available to the actual C method body. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Service.pm libbread-board-perl-0.37/lib/Bread/Board/Service.pm --- libbread-board-perl-0.32/lib/Bread/Board/Service.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Service.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Service; -BEGIN { - $Bread::Board::Service::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Service::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: Base service role +$Bread::Board::Service::VERSION = '0.37'; use Moose::Role; use Module::Runtime (); @@ -125,51 +124,113 @@ =head1 NAME -Bread::Board::Service +Bread::Board::Service - Base service role =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION +This role is the basis for all services in L. It +provides (or requires the implementation of) the minimum necessary +building blocks: creating an instance, setting/getting parameters, +instance lifecycle. + +=head1 ATTRIBUTES + +=head2 C + +Read/write string, required. Every service needs a name, by which it +can be referenced when L. + +=head2 C + +Boolean, defaults to false. Used during L +to detect loops. + +=head2 C + + $service->lifecycle('Singleton'); + +Read/write string; it should be either a partial class name under the +C namespace (like C for +C) or a full class name prefixed +with C<+> (like C<+My::Special::Lifecycle>). The name is expected to +refer to a loadable I, which will be applied to the service +instance. + =head1 METHODS -=over 4 +=head2 C -=item B +Locks the service; you should never need to call this method in normal +code. -=item B +=head2 C -=item B +Unlocks the service; you should never need to call this method in +normal code. -=item B +=head2 C -=item B + my $value = $service->get(); -=item B +This method I be implemented by the consuming class. It's +expected to instantiate whatever object or value this service should +resolve to. -=item B +=head2 C -=item B +Builder for the service parameters, defaults to returning an empty +hashref. -=item B +=head2 C -=back +Clearer of the service parameters. -=head1 BUGS +=head2 C + + my @param_names = $service->param(); + my $param_value = $service->param($param_name); + $service->param($name1=>$value1,$name2=>$value2); + +Getter/setter for the service parameters; notice that calling this +method with no arguments returns the list of parameter names. + +I: these are not the same as the L (although +those will be copied here before C is called), nor are they the +same thing as L +(although the resolved dependencies will be copied here before C +is called). + +=head2 C -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. +When declaring a service using the L<< C helper +function|Bread::Board/service >>, if the name you use starts with a +C<'+'>, the service definition will extend an existing service with +the given name (without the C<'+'>). This method implements the +extension semantics: the C and C options +will be merged with the existing values, rather than overridden. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/SetterInjection.pm libbread-board-perl-0.37/lib/Bread/Board/SetterInjection.pm --- libbread-board-perl-0.32/lib/Bread/Board/SetterInjection.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/SetterInjection.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,13 +1,12 @@ package Bread::Board::SetterInjection; -BEGIN { - $Bread::Board::SetterInjection::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::SetterInjection::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: service instantiating objects via setter functions +$Bread::Board::SetterInjection::VERSION = '0.37'; use Moose; use Bread::Board::Types; -with 'Bread::Board::Service::WithClass', +with 'Bread::Board::Service::WithConstructor', 'Bread::Board::Service::WithParameters', 'Bread::Board::Service::WithDependencies'; @@ -15,7 +14,8 @@ sub get { my $self = shift; - my $o = $self->class->new; + my $constructor = $self->constructor_name; + my $o = $self->class->$constructor(); $o->$_($self->param($_)) foreach $self->param; return $o; } @@ -32,35 +32,55 @@ =head1 NAME -Bread::Board::SetterInjection +Bread::Board::SetterInjection - service instantiating objects via setter functions =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION -=head1 METHODS +This L class instantiates objects by +calling C on a class, then calling setters on the returned +object. -=over 4 +This class consumes L, +L, +L. -=item B +=head1 ATTRIBUTES -=back +=head2 C -=head1 BUGS +Attribute provided by L. This +service makes it a required attribute: you can't call a constructor if +you don't have a class. + +=head1 METHODS -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. +=head2 C + +Calls the C method on the L to get the object to return; +then, for each of the L, calls a setter with the same +name as the parameter, passing it the parameter's value. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Traversable.pm libbread-board-perl-0.37/lib/Bread/Board/Traversable.pm --- libbread-board-perl-0.32/lib/Bread/Board/Traversable.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Traversable.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Traversable; -BEGIN { - $Bread::Board::Traversable::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Traversable::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: role for traversing a container service tree +$Bread::Board::Traversable::VERSION = '0.37'; use Moose::Role; with 'MooseX::Clone' => { -version => 0.05 }; @@ -116,45 +115,80 @@ =head1 NAME -Bread::Board::Traversable +Bread::Board::Traversable - role for traversing a container service tree =head1 VERSION -version 0.32 +version 0.37 =head1 SYNOPSIS + my $service = $container->fetch('/some/service/path'); + + my $root = $service->get_root_container; + =head1 DESCRIPTION +This role provides the basic functionality to traverse a container / +service tree. Instances of classes consuming this role will get a +parent-child relationship between them. + +=head1 ATTRIBUTES + +=head2 C + +Weak ref to another L object, read/write +accessor (although you should probably not change this value directly +in normal code). + =head1 METHODS -=over 4 +=head2 C -=item B +Predicate for the L attribute, true if a parent has been set. -=item B +=head2 C -=item B +Clearer for the L attribute, you should probably not call +this method in normal code. -=item B +=head2 C -=item B +Returns the farthest ancestor of the invocant, i.e. the top-most +container this object is a part of. -=back +=head2 C -=head1 BUGS + my $service = $this->fetch('/absolute/path'); + my $service = $this->fetch('relative/path'); + my $service = $this->fetch('../relative/path'); + +Given a (relative or absolute) path to a service or container, this +method walks the tree and returns the L or +L instance for that path. Dies if no object +can be found for the given +path. -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. +L are resolved in this call, by +calling L<< C|Bread::Board::Service::Alias/aliased_from +>> until we get an actual service. =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board/Types.pm libbread-board-perl-0.37/lib/Bread/Board/Types.pm --- libbread-board-perl-0.32/lib/Bread/Board/Types.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board/Types.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,7 @@ package Bread::Board::Types; -BEGIN { - $Bread::Board::Types::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::Types::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +# ABSTRACT: types and coercions for Bread::Board +$Bread::Board::Types::VERSION = '0.37'; use Moose::Util::TypeConstraints; use Scalar::Util qw(blessed); @@ -112,27 +111,142 @@ =head1 NAME -Bread::Board::Types +Bread::Board::Types - types and coercions for Bread::Board =head1 VERSION -version 0.32 +version 0.37 =head1 DESCRIPTION -=head1 BUGS +This package defines types and coercions for L. + +=head1 TYPES + +=head2 C + +A hashref mapping strings to instances of L +or L. + +Can be coerced from an arrayref of containers: the keys will be the +containers' names. + +=head2 C + +A hashref mapping strings to instances of L. + +Can be coerced from an arrayref of services: the keys will be the +services' names. + +=head2 C + +Hashref mapping strings to instances of L. + +The values of the hashref can be coerced in several different ways: + +=over 4 + +=item a string + +will be interpreted as the L<< C|Bread::Board::Dependency/service_path >> + +=item a hashref with a single key + +the key will be interpreted as a L<< +C|Bread::Board::Dependency/service_path >>, and the +value as a hashref for L<< +C|Bread::Board::Dependency/service_params >> + +=item an arrayref + +each element will be interpreted as a dependency (possibly through all +the coercions listed here); see below for an example + +=item a L object + +will be interpreted as a dependency on that service -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. +=item a L object + +will be taken as-is + +=back + +Instead of a hashref of any of the above things, you can use an +arrayref: it will be coerced to hashref, using the (coerced) +dependencies' names as keys. + +=head3 Examples + + service foo => ( + class => 'Foo', + dependencies => { + { bar => { attribute => 12 } }, + }, + ); + +The service C depends on the parameterized service C, and +C will be instantiated passing the hashref C<< { attribute => 12 +} >> to its L<< C|Bread::Board::Service::WithParameters/get >> +method. + + service foo => ( + class => 'Foo', + dependencies => { + things => [ 'bar', 'baz' ], + }, + ); + +The service C depends on the services C and C, and when +instantiating C, its constructor will receive something like C<< +things => [ $instance_of_bar, $instance_of_baz ] >>. + + service foo => ( + class => 'Foo', + dependencies => { + things => [ + { bar => { attribute => 12 } }, + { bar => { attribute => 27 } }, + ], + }, + ); + +You can mix&match the coercions! This C will get two different +instances of C in its C attribute, each C +instantiated with a different value. + +=head2 C + +Hashref mapping strings to L specifications. + +Can be coerced from an arrayref of strings: + + [qw(a b c)] + +becomes: + + { + a => { optional => 0 }, + b => { optional => 0 }, + c => { optional => 0 }, + } =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/lib/Bread/Board.pm libbread-board-perl-0.37/lib/Bread/Board.pm --- libbread-board-perl-0.32/lib/Bread/Board.pm 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/lib/Bread/Board.pm 2019-06-28 23:19:54.000000000 +0000 @@ -1,8 +1,6 @@ package Bread::Board; -BEGIN { - $Bread::Board::AUTHORITY = 'cpan:STEVAN'; -} -$Bread::Board::VERSION = '0.32'; +our $AUTHORITY = 'cpan:STEVAN'; +$Bread::Board::VERSION = '0.37'; use strict; use warnings; use Carp qw(confess); @@ -33,6 +31,7 @@ include typemap infer + literal ]], ); @@ -238,6 +237,15 @@ Bread::Board::Dependency->new(service_path => $path); } +my $LITERAL_ANON = 0; +sub literal($) { + my $value = shift; + Bread::Board::Literal->new( + name => 'LITERAL_ANON_' . $LITERAL_ANON++, + value => $value, + ); +} + 1; __END__ @@ -252,7 +260,7 @@ =head1 VERSION -version 0.32 +version 0.37 =head1 SYNOPSIS @@ -266,7 +274,6 @@ class => 'FileLogger', lifecycle => 'Singleton', dependencies => [ 'log_file_name' ], - ] ); container 'Database' => as { @@ -361,9 +368,11 @@ the objects manually instead, but your code may be more difficult to understand. -=over 4 +=head2 C + +=head3 simple case -=item I + container $name, \&body; This function constructs and returns an instance of L. The (optional) C<&body> block may be used to add services or sub-containers @@ -382,7 +391,9 @@ another container, then this declaration will instead extend an existing container with the name C<$name> (without the C<'+'>). -=item I +=head3 from an instance + + container $container_instance, \&body In many cases, subclassing L is the easiest route to getting access to this framework. You can do this and still get all the @@ -405,7 +416,9 @@ }; } -=item I +=head3 with parameters + + container $name, \@parameters, \&body A third way of using the C function is to build a parameterized container. These are useful as a way of providing a placeholder for parts of @@ -415,23 +428,32 @@ For more detail on how you might use parameterized containers, see L. -=item I +=head2 C + + as { some_code() }; This is just a replacement for the C keyword that is easier to read when defining containers. -=item I +=head2 C + + service $name, $literal; + service $name, %service_description; Within the C blocks for your containers, you may construct services using the C function. This can construct several different kinds of services based upon how it is called. +=head3 literal services + To build a literal service (a L object), just specify a scalar value or reference you want to use as the literal value: # In case you need to adjust the gravitational constant of the Universe service gravitational_constant => 6.673E-11; +=head3 using injections + To build a service using one of the injection services, just fill in all the details required to use that sort of injection: @@ -458,6 +480,8 @@ L (and you must provide the C option). +=head3 service dependencies + The C parameter takes a hashref of dependency names mapped to L objects, but there are several coercions and sugar functions available to make specifying dependencies as easy as possible. The @@ -517,6 +541,8 @@ # ... ); +=head3 inheriting and extending services + If the C<$name> starts with a C<'+'>, the service definition will instead extend an existing service with the given C<$name> (without the C<'+'>). This works similarly to the C syntax in Moose. It is most useful when @@ -527,12 +553,40 @@ be extended, because there's nothing to extend. You can still override them entirely by declaring the service name without a leading C<'+'>. -=item I +=head2 C + + literal($value); + +Creates an anonymous L object with the given value. + + service 'dbh' => ( + block => sub { + my $s = shift; + require DBI; + DBI->connect( + $s->param('dsn'), + $s->param('username'), + $s->param('password'), + ) || die "Could not connect"; + }, + dependencies => { + dsn => literal 'dbi:SQLite:somedb', + username => literal 'foo', + password => literal 'password', + + }, + ); + +=head2 C + + depends_on($service_path); The C function creates a L object for the named C<$service_path> and returns it. -=item I +=head2 C + + wire_names(@service_names); This function is just a shortcut for passing a hash reference of dependencies into the service. It is not typically needed, since Bread::Board can usually @@ -566,7 +620,10 @@ dependencies => [ qw(foo bar baz ) ], ); -=item I +=head2 C + + typemap $type, $service; + typemap $type, $service_path; This creates a type mapping for the named type. Typically, it is paired with the C call like so: @@ -576,7 +633,10 @@ For more details on what type mapping is and how it works, see L. -=item I +=head2 C + + infer; + infer(%hints); This is used with C to help create the typemap inference. It can be used with no arguments to do everything automatically. However, in some cases, @@ -592,7 +652,9 @@ For more details on what type mapping is and how it works, see L. -=item I +=head2 C + + include $file; This is a shortcut for loading a Bread::Board configuration from another file. @@ -604,12 +666,17 @@ However, you might find it more readable to use C. -=item I +=head2 C + + alias $service_name, $service_path, %service_description; -This helper allows for the creation of service aliases, which allows you to -define a service in one place and then reuse that service with a different name -somewhere else. This is sort of like a symbolic link for services. Aliases will -be resolved recursively, so an alias can alias an alias. +This helper allows for the creation of L, which allows you to define a +service in one place and then reuse that service with a different name +somewhere else. This is sort of like a symbolic link for +services. Aliases will be L, so an alias can alias an +alias. For example, @@ -619,15 +686,13 @@ alias my_logger => 'file_logger'; -=back - =head1 OTHER FUNCTIONS These are not exported, but might be helpful to you. -=over 4 +=head2 C -=item I + set_root_container $container; You may use this to set a top-level root container for all container definitions. @@ -642,8 +707,6 @@ Here the C<$config> container would be created as a sub-container of C<$app>. -=back - =head1 ACKNOWLEDGEMENTS Thanks to Daisuke Maki for his contributions and for really @@ -656,6 +719,9 @@ Matt "mst" Trout, for finally coming up with the best name for this module. +Gianni "dakkar" Ceccarelli for writing lots of documentation, and +Net-a-Porter.com for paying his salary while he was doing it. + =head1 ARTICLES L @@ -677,19 +743,22 @@ =back -=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 Github Issues. - =head1 AUTHOR Stevan Little +=head1 BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/LICENSE libbread-board-perl-0.37/LICENSE --- libbread-board-perl-0.32/LICENSE 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/LICENSE 2019-06-28 23:19:54.000000000 +0000 @@ -1,4 +1,4 @@ -This software is copyright (c) 2014 by Infinity Interactive. +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. 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,7 +12,7 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2014 by Infinity Interactive. +This software is Copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software, licensed under: @@ -272,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2014 by Infinity Interactive. +This software is Copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. This is free software, licensed under: diff -Nru libbread-board-perl-0.32/Makefile.PL libbread-board-perl-0.37/Makefile.PL --- libbread-board-perl-0.32/Makefile.PL 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/Makefile.PL 2019-06-28 23:19:54.000000000 +0000 @@ -1,24 +1,20 @@ - -# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.014. +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.012. use strict; use warnings; +use 5.006; - -use ExtUtils::MakeMaker 6.30; - - +use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "A solderless way to wire up your application components", "AUTHOR" => "Stevan Little ", - "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { - "ExtUtils::MakeMaker" => "6.30" + "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Bread-Board", - "EXE_FILES" => [], "LICENSE" => "perl", + "MIN_PERL_VERSION" => "5.006", "NAME" => "Bread::Board", "PREREQ_PM" => { "Carp" => 0, @@ -37,16 +33,17 @@ "warnings" => 0 }, "TEST_REQUIRES" => { + "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "FindBin" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::Fatal" => 0, "Test::Moose" => 0, - "Test::More" => "0.88", + "Test::More" => 0, "Test::Requires" => 0 }, - "VERSION" => "0.32", + "VERSION" => "0.37", "test" => { "TESTS" => "t/*.t" } @@ -55,6 +52,7 @@ my %FallbackPrereqs = ( "Carp" => 0, + "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "FindBin" => 0, "IO::Handle" => 0, @@ -70,7 +68,7 @@ "Scalar::Util" => 0, "Test::Fatal" => 0, "Test::Moose" => 0, - "Test::More" => "0.88", + "Test::More" => 0, "Test::Requires" => 0, "Try::Tiny" => 0, "overload" => 0, @@ -89,6 +87,3 @@ unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); - - - diff -Nru libbread-board-perl-0.32/MANIFEST libbread-board-perl-0.37/MANIFEST --- libbread-board-perl-0.32/MANIFEST 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/MANIFEST 2019-06-28 23:19:54.000000000 +0000 @@ -1,12 +1,16 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.014. +CODE_OF_CONDUCT.md +CONTRIBUTORS Changes +INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL -README -dist.ini +README.mkdn +SIGNATURE +cpanfile +doap.xml lib/Bread/Board.pm lib/Bread/Board/BlockInjection.pm lib/Bread/Board/ConstructorInjection.pm @@ -32,12 +36,15 @@ lib/Bread/Board/Service/Deferred/Thunk.pm lib/Bread/Board/Service/Inferred.pm lib/Bread/Board/Service/WithClass.pm +lib/Bread/Board/Service/WithConstructor.pm lib/Bread/Board/Service/WithDependencies.pm lib/Bread/Board/Service/WithParameters.pm lib/Bread/Board/SetterInjection.pm lib/Bread/Board/Traversable.pm lib/Bread/Board/Types.pm t/00-compile.t +t/00-report-prereqs.dd +t/00-report-prereqs.t t/001_constructor_injection.t t/002_setter_injection.t t/003_block_injection.t @@ -101,11 +108,10 @@ t/300_no_new.t t/301_sugar.t t/302_path_traversal_deprecation.t +t/310_literal_keyword.t +t/500-gh61.t t/lib/bad.bb t/lib/false.bb t/lib/logger.bb t/lib/my_app.bb -xt/release/eol.t -xt/release/no-tabs.t -xt/release/pod-coverage.t -xt/release/pod-syntax.t +xt/release/unused-vars.t diff -Nru libbread-board-perl-0.32/META.json libbread-board-perl-0.37/META.json --- libbread-board-perl-0.32/META.json 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/META.json 2019-06-28 23:19:54.000000000 +0000 @@ -4,28 +4,25 @@ "Stevan Little " ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 5.014, CPAN::Meta::Converter version 2.140640", + "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : "2" + "version" : 2 }, "name" : "Bread-Board", "prereqs" : { "configure" : { "requires" : { - "ExtUtils::MakeMaker" : "6.30" + "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { - "Pod::Coverage::TrustPod" : "0", - "Test::More" : "0", - "Test::NoTabs" : "0", - "Test::Pod" : "1.41", - "Test::Pod::Coverage" : "1.08" + "Test::More" : "0.96", + "Test::Vars" : "0" } }, "runtime" : { @@ -47,14 +44,18 @@ } }, "test" : { + "recommends" : { + "CPAN::Meta" : "2.120900" + }, "requires" : { + "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "FindBin" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::Fatal" : "0", "Test::Moose" : "0", - "Test::More" : "0.88", + "Test::More" : "0", "Test::Requires" : "0", "perl" : "5.006" } @@ -63,95 +64,99 @@ "provides" : { "Bread::Board" : { "file" : "lib/Bread/Board.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::BlockInjection" : { "file" : "lib/Bread/Board/BlockInjection.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::ConstructorInjection" : { "file" : "lib/Bread/Board/ConstructorInjection.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Container" : { "file" : "lib/Bread/Board/Container.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Container::FromParameterized" : { "file" : "lib/Bread/Board/Container/FromParameterized.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Container::Parameterized" : { "file" : "lib/Bread/Board/Container/Parameterized.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Dependency" : { "file" : "lib/Bread/Board/Dependency.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Dumper" : { "file" : "lib/Bread/Board/Dumper.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::LifeCycle" : { "file" : "lib/Bread/Board/LifeCycle.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::LifeCycle::Singleton" : { "file" : "lib/Bread/Board/LifeCycle/Singleton.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::LifeCycle::Singleton::WithParameters" : { "file" : "lib/Bread/Board/LifeCycle/Singleton/WithParameters.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Literal" : { "file" : "lib/Bread/Board/Literal.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Service" : { "file" : "lib/Bread/Board/Service.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Service::Alias" : { "file" : "lib/Bread/Board/Service/Alias.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Service::Deferred" : { "file" : "lib/Bread/Board/Service/Deferred.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Service::Deferred::Thunk" : { "file" : "lib/Bread/Board/Service/Deferred/Thunk.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Service::Inferred" : { "file" : "lib/Bread/Board/Service/Inferred.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Service::WithClass" : { "file" : "lib/Bread/Board/Service/WithClass.pm", - "version" : "0.32" + "version" : "0.37" + }, + "Bread::Board::Service::WithConstructor" : { + "file" : "lib/Bread/Board/Service/WithConstructor.pm", + "version" : "0.37" }, "Bread::Board::Service::WithDependencies" : { "file" : "lib/Bread/Board/Service/WithDependencies.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Service::WithParameters" : { "file" : "lib/Bread/Board/Service/WithParameters.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::SetterInjection" : { "file" : "lib/Bread/Board/SetterInjection.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Traversable" : { "file" : "lib/Bread/Board/Traversable.pm", - "version" : "0.32" + "version" : "0.37" }, "Bread::Board::Types" : { "file" : "lib/Bread/Board/Types.pm", - "version" : "0.32" + "version" : "0.37" } }, "release_status" : "stable", @@ -159,434 +164,46 @@ "bugtracker" : { "web" : "https://github.com/stevan/BreadBoard/issues" }, - "homepage" : "http://metacpan.org/release/Bread-Board", + "homepage" : "https://github.com/stevan/BreadBoard", "repository" : { "type" : "git", - "url" : "git://github.com/stevan/BreadBoard.git", + "url" : "https://github.com/stevan/BreadBoard.git", "web" : "https://github.com/stevan/BreadBoard" } }, - "version" : "0.32", - "x_Dist_Zilla" : { - "perl" : { - "version" : "5.018002" - }, - "plugins" : [ - { - "class" : "Dist::Zilla::Plugin::Prereqs", - "config" : { - "Dist::Zilla::Plugin::Prereqs" : { - "phase" : "test", - "type" : "requires" - } - }, - "name" : "@DOY/TestMoreDoneTesting", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::GatherDir", - "name" : "@DOY/GatherDir", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::PruneCruft", - "name" : "@DOY/PruneCruft", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::ManifestSkip", - "name" : "@DOY/ManifestSkip", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::MetaYAML", - "name" : "@DOY/MetaYAML", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::License", - "name" : "@DOY/License", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::Readme", - "name" : "@DOY/Readme", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::RunExtraTests", - "config" : { - "Dist::Zilla::Role::TestRunner" : { - "default_jobs" : 1 - } - }, - "name" : "@DOY/RunExtraTests", - "version" : "0.018" - }, - { - "class" : "Dist::Zilla::Plugin::ExecDir", - "name" : "@DOY/ExecDir", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::ShareDir", - "name" : "@DOY/ShareDir", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::MakeMaker", - "config" : { - "Dist::Zilla::Role::TestRunner" : { - "default_jobs" : 1 - } - }, - "name" : "@DOY/MakeMaker", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::Manifest", - "name" : "@DOY/Manifest", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::TestRelease", - "name" : "@DOY/TestRelease", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::ConfirmRelease", - "name" : "@DOY/ConfirmRelease", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::MetaConfig", - "name" : "@DOY/MetaConfig", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::MetaJSON", - "name" : "@DOY/MetaJSON", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::NextRelease", - "name" : "@DOY/NextRelease", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::CheckChangesHasContent", - "name" : "@DOY/CheckChangesHasContent", - "version" : "0.006" - }, - { - "class" : "Dist::Zilla::Plugin::PkgVersion", - "name" : "@DOY/PkgVersion", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::Authority", - "name" : "@DOY/Authority", - "version" : "1.006" - }, - { - "class" : "Dist::Zilla::Plugin::PodCoverageTests", - "name" : "@DOY/PodCoverageTests", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::PodSyntaxTests", - "name" : "@DOY/PodSyntaxTests", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::NoTabsTests", - "config" : { - "Dist::Zilla::Plugin::Test::NoTabs" : { - "module_finder" : [ - ":InstallModules" - ], - "script_finder" : [ - ":ExecFiles", - ":TestFiles" - ] - } - }, - "name" : "@DOY/NoTabsTests", - "version" : "0.07" - }, - { - "class" : "Dist::Zilla::Plugin::EOLTests", - "name" : "@DOY/EOLTests", - "version" : "0.02" - }, - { - "class" : "Dist::Zilla::Plugin::Test::Compile", - "config" : { - "Dist::Zilla::Plugin::Test::Compile" : { - "filename" : "t/00-compile.t", - "module_finder" : [ - ":InstallModules" - ], - "script_finder" : [ - ":ExecFiles" - ] - } - }, - "name" : "@DOY/Test::Compile", - "version" : "2.039" - }, - { - "class" : "Dist::Zilla::Plugin::Metadata", - "name" : "@DOY/Metadata", - "version" : "3.03" - }, - { - "class" : "Dist::Zilla::Plugin::MetaResources", - "name" : "@DOY/MetaResources", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::Git::Check", - "name" : "@DOY/Git::Check", - "version" : "2.020" - }, - { - "class" : "Dist::Zilla::Plugin::Git::Commit", - "name" : "@DOY/Git::Commit", - "version" : "2.020" - }, - { - "class" : "Dist::Zilla::Plugin::Git::Tag", - "name" : "@DOY/Git::Tag", - "version" : "2.020" - }, - { - "class" : "Dist::Zilla::Plugin::Git::NextVersion", - "name" : "@DOY/Git::NextVersion", - "version" : "2.020" - }, - { - "class" : "Dist::Zilla::Plugin::ContributorsFromGit", - "name" : "@DOY/ContributorsFromGit", - "version" : "0.006" - }, - { - "class" : "Dist::Zilla::Plugin::MetaProvides::Package", - "config" : { - "Dist::Zilla::Plugin::MetaProvides::Package" : { - "finder_objects" : [ - { - "class" : "Dist::Zilla::Plugin::FinderCode", - "name" : "@DOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM", - "version" : "5.014" - } - ] - }, - "Dist::Zilla::Role::MetaProvider::Provider" : { - "inherit_missing" : "1", - "inherit_version" : "1", - "meta_noindex" : "1" - } - }, - "name" : "@DOY/MetaProvides::Package", - "version" : "2.000001" - }, - { - "class" : "Dist::Zilla::Plugin::PodWeaver", - "config" : { - "Dist::Zilla::Plugin::PodWeaver" : { - "finder" : [ - ":InstallModules", - ":ExecFiles" - ], - "plugins" : [ - { - "class" : "Pod::Weaver::Plugin::EnsurePod5", - "name" : "@CorePrep/EnsurePod5", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Plugin::H1Nester", - "name" : "@CorePrep/H1Nester", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Plugin::SingleEncoding", - "name" : "@Default/SingleEncoding", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Name", - "name" : "@Default/Name", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Version", - "name" : "@Default/Version", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Region", - "name" : "@Default/prelude", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Generic", - "name" : "SYNOPSIS", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Generic", - "name" : "DESCRIPTION", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Generic", - "name" : "OVERVIEW", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Collect", - "name" : "ATTRIBUTES", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Collect", - "name" : "METHODS", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Collect", - "name" : "FUNCTIONS", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Leftovers", - "name" : "@Default/Leftovers", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Region", - "name" : "@Default/postlude", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Authors", - "name" : "@Default/Authors", - "version" : "4.006" - }, - { - "class" : "Pod::Weaver::Section::Legal", - "name" : "@Default/Legal", - "version" : "4.006" - } - ] - } - }, - "name" : "@DOY/PodWeaver", - "version" : "4.005" - }, - { - "class" : "Dist::Zilla::Plugin::UploadToCPAN", - "name" : "@DOY/UploadToCPAN", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::AutoPrereqs", - "name" : "AutoPrereqs", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::ContributorsFromGit", - "name" : "ContributorsFromGit", - "version" : "0.006" - }, - { - "class" : "Dist::Zilla::Plugin::Prereqs", - "config" : { - "Dist::Zilla::Plugin::Prereqs" : { - "phase" : "develop", - "type" : "requires" - } - }, - "name" : "DevelopRequires", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::FinderCode", - "name" : ":InstallModules", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::FinderCode", - "name" : ":IncModules", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::FinderCode", - "name" : ":TestFiles", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::FinderCode", - "name" : ":ExecFiles", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::FinderCode", - "name" : ":ShareFiles", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::FinderCode", - "name" : ":MainModule", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::FinderCode", - "name" : ":AllFiles", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::FinderCode", - "name" : ":NoFiles", - "version" : "5.014" - }, - { - "class" : "Dist::Zilla::Plugin::FinderCode", - "name" : "@DOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM", - "version" : "5.014" - } - ], - "zilla" : { - "class" : "Dist::Zilla::Dist::Builder", - "config" : { - "is_trial" : "0" - }, - "version" : "5.014" - } - }, + "version" : "0.37", "x_authority" : "cpan:STEVAN", + "x_contributor_covenant" : { + "version" : 0.01 + }, "x_contributors" : [ - "André Walker ", + "Alex Balhatchet ", + "Andr\u00e9 Walker ", + "ben hengst ", "Brad Bowman ", "Caleb Cushing ", "Daisuke Maki ", + "Dave Rolsky ", "Florian Ragwitz ", "Gabor Szabo ", "Gianni Ceccarelli ", + "Graham Knop ", "Jason Galea ", "Jason May ", "Jay Hannah ", "Jesse Luehrs ", "Jonathan Rockway ", "Kip Hampton ", + "Mohammad S Anwar ", "Neil Bowers ", "Philippe Bruhat (BooK) ", "Sterling Hanenkamp ", "Tomas Doran ", - "ben hengst ", + "Yanick Champoux ", + "Yanick Champoux ", "zdk " - ] + ], + "x_generated_by_perl" : "v5.20.2", + "x_serialization_backend" : "Cpanel::JSON::XS version 3.0115" } diff -Nru libbread-board-perl-0.32/META.yml libbread-board-perl-0.37/META.yml --- libbread-board-perl-0.32/META.yml 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/META.yml 2019-06-28 23:19:54.000000000 +0000 @@ -3,19 +3,20 @@ author: - 'Stevan Little ' build_requires: + ExtUtils::MakeMaker: '0' File::Spec: '0' FindBin: '0' IO::Handle: '0' IPC::Open3: '0' Test::Fatal: '0' Test::Moose: '0' - Test::More: '0.88' + Test::More: '0' Test::Requires: '0' perl: '5.006' configure_requires: - ExtUtils::MakeMaker: '6.30' + ExtUtils::MakeMaker: '0' dynamic_config: 0 -generated_by: 'Dist::Zilla version 5.014, CPAN::Meta::Converter version 2.140640' +generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -24,73 +25,76 @@ provides: Bread::Board: file: lib/Bread/Board.pm - version: '0.32' + version: '0.37' Bread::Board::BlockInjection: file: lib/Bread/Board/BlockInjection.pm - version: '0.32' + version: '0.37' Bread::Board::ConstructorInjection: file: lib/Bread/Board/ConstructorInjection.pm - version: '0.32' + version: '0.37' Bread::Board::Container: file: lib/Bread/Board/Container.pm - version: '0.32' + version: '0.37' Bread::Board::Container::FromParameterized: file: lib/Bread/Board/Container/FromParameterized.pm - version: '0.32' + version: '0.37' Bread::Board::Container::Parameterized: file: lib/Bread/Board/Container/Parameterized.pm - version: '0.32' + version: '0.37' Bread::Board::Dependency: file: lib/Bread/Board/Dependency.pm - version: '0.32' + version: '0.37' Bread::Board::Dumper: file: lib/Bread/Board/Dumper.pm - version: '0.32' + version: '0.37' Bread::Board::LifeCycle: file: lib/Bread/Board/LifeCycle.pm - version: '0.32' + version: '0.37' Bread::Board::LifeCycle::Singleton: file: lib/Bread/Board/LifeCycle/Singleton.pm - version: '0.32' + version: '0.37' Bread::Board::LifeCycle::Singleton::WithParameters: file: lib/Bread/Board/LifeCycle/Singleton/WithParameters.pm - version: '0.32' + version: '0.37' Bread::Board::Literal: file: lib/Bread/Board/Literal.pm - version: '0.32' + version: '0.37' Bread::Board::Service: file: lib/Bread/Board/Service.pm - version: '0.32' + version: '0.37' Bread::Board::Service::Alias: file: lib/Bread/Board/Service/Alias.pm - version: '0.32' + version: '0.37' Bread::Board::Service::Deferred: file: lib/Bread/Board/Service/Deferred.pm - version: '0.32' + version: '0.37' Bread::Board::Service::Deferred::Thunk: file: lib/Bread/Board/Service/Deferred/Thunk.pm - version: '0.32' + version: '0.37' Bread::Board::Service::Inferred: file: lib/Bread/Board/Service/Inferred.pm - version: '0.32' + version: '0.37' Bread::Board::Service::WithClass: file: lib/Bread/Board/Service/WithClass.pm - version: '0.32' + version: '0.37' + Bread::Board::Service::WithConstructor: + file: lib/Bread/Board/Service/WithConstructor.pm + version: '0.37' Bread::Board::Service::WithDependencies: file: lib/Bread/Board/Service/WithDependencies.pm - version: '0.32' + version: '0.37' Bread::Board::Service::WithParameters: file: lib/Bread/Board/Service/WithParameters.pm - version: '0.32' + version: '0.37' Bread::Board::SetterInjection: file: lib/Bread/Board/SetterInjection.pm - version: '0.32' + version: '0.37' Bread::Board::Traversable: file: lib/Bread/Board/Traversable.pm - version: '0.32' + version: '0.37' Bread::Board::Types: file: lib/Bread/Board/Types.pm - version: '0.32' + version: '0.37' requires: Carp: '0' Module::Runtime: '0' @@ -108,333 +112,37 @@ warnings: '0' resources: bugtracker: https://github.com/stevan/BreadBoard/issues - homepage: http://metacpan.org/release/Bread-Board - repository: git://github.com/stevan/BreadBoard.git -version: '0.32' -x_Dist_Zilla: - perl: - version: '5.018002' - plugins: - - - class: Dist::Zilla::Plugin::Prereqs - config: - Dist::Zilla::Plugin::Prereqs: - phase: test - type: requires - name: '@DOY/TestMoreDoneTesting' - version: '5.014' - - - class: Dist::Zilla::Plugin::GatherDir - name: '@DOY/GatherDir' - version: '5.014' - - - class: Dist::Zilla::Plugin::PruneCruft - name: '@DOY/PruneCruft' - version: '5.014' - - - class: Dist::Zilla::Plugin::ManifestSkip - name: '@DOY/ManifestSkip' - version: '5.014' - - - class: Dist::Zilla::Plugin::MetaYAML - name: '@DOY/MetaYAML' - version: '5.014' - - - class: Dist::Zilla::Plugin::License - name: '@DOY/License' - version: '5.014' - - - class: Dist::Zilla::Plugin::Readme - name: '@DOY/Readme' - version: '5.014' - - - class: Dist::Zilla::Plugin::RunExtraTests - config: - Dist::Zilla::Role::TestRunner: - default_jobs: 1 - name: '@DOY/RunExtraTests' - version: '0.018' - - - class: Dist::Zilla::Plugin::ExecDir - name: '@DOY/ExecDir' - version: '5.014' - - - class: Dist::Zilla::Plugin::ShareDir - name: '@DOY/ShareDir' - version: '5.014' - - - class: Dist::Zilla::Plugin::MakeMaker - config: - Dist::Zilla::Role::TestRunner: - default_jobs: 1 - name: '@DOY/MakeMaker' - version: '5.014' - - - class: Dist::Zilla::Plugin::Manifest - name: '@DOY/Manifest' - version: '5.014' - - - class: Dist::Zilla::Plugin::TestRelease - name: '@DOY/TestRelease' - version: '5.014' - - - class: Dist::Zilla::Plugin::ConfirmRelease - name: '@DOY/ConfirmRelease' - version: '5.014' - - - class: Dist::Zilla::Plugin::MetaConfig - name: '@DOY/MetaConfig' - version: '5.014' - - - class: Dist::Zilla::Plugin::MetaJSON - name: '@DOY/MetaJSON' - version: '5.014' - - - class: Dist::Zilla::Plugin::NextRelease - name: '@DOY/NextRelease' - version: '5.014' - - - class: Dist::Zilla::Plugin::CheckChangesHasContent - name: '@DOY/CheckChangesHasContent' - version: '0.006' - - - class: Dist::Zilla::Plugin::PkgVersion - name: '@DOY/PkgVersion' - version: '5.014' - - - class: Dist::Zilla::Plugin::Authority - name: '@DOY/Authority' - version: '1.006' - - - class: Dist::Zilla::Plugin::PodCoverageTests - name: '@DOY/PodCoverageTests' - version: '5.014' - - - class: Dist::Zilla::Plugin::PodSyntaxTests - name: '@DOY/PodSyntaxTests' - version: '5.014' - - - class: Dist::Zilla::Plugin::NoTabsTests - config: - Dist::Zilla::Plugin::Test::NoTabs: - module_finder: - - ':InstallModules' - script_finder: - - ':ExecFiles' - - ':TestFiles' - name: '@DOY/NoTabsTests' - version: '0.07' - - - class: Dist::Zilla::Plugin::EOLTests - name: '@DOY/EOLTests' - version: '0.02' - - - class: Dist::Zilla::Plugin::Test::Compile - config: - Dist::Zilla::Plugin::Test::Compile: - filename: t/00-compile.t - module_finder: - - ':InstallModules' - script_finder: - - ':ExecFiles' - name: '@DOY/Test::Compile' - version: '2.039' - - - class: Dist::Zilla::Plugin::Metadata - name: '@DOY/Metadata' - version: '3.03' - - - class: Dist::Zilla::Plugin::MetaResources - name: '@DOY/MetaResources' - version: '5.014' - - - class: Dist::Zilla::Plugin::Git::Check - name: '@DOY/Git::Check' - version: '2.020' - - - class: Dist::Zilla::Plugin::Git::Commit - name: '@DOY/Git::Commit' - version: '2.020' - - - class: Dist::Zilla::Plugin::Git::Tag - name: '@DOY/Git::Tag' - version: '2.020' - - - class: Dist::Zilla::Plugin::Git::NextVersion - name: '@DOY/Git::NextVersion' - version: '2.020' - - - class: Dist::Zilla::Plugin::ContributorsFromGit - name: '@DOY/ContributorsFromGit' - version: '0.006' - - - class: Dist::Zilla::Plugin::MetaProvides::Package - config: - Dist::Zilla::Plugin::MetaProvides::Package: - finder_objects: - - - class: Dist::Zilla::Plugin::FinderCode - name: '@DOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM' - version: '5.014' - Dist::Zilla::Role::MetaProvider::Provider: - inherit_missing: '1' - inherit_version: '1' - meta_noindex: '1' - name: '@DOY/MetaProvides::Package' - version: '2.000001' - - - class: Dist::Zilla::Plugin::PodWeaver - config: - Dist::Zilla::Plugin::PodWeaver: - finder: - - ':InstallModules' - - ':ExecFiles' - plugins: - - - class: Pod::Weaver::Plugin::EnsurePod5 - name: '@CorePrep/EnsurePod5' - version: '4.006' - - - class: Pod::Weaver::Plugin::H1Nester - name: '@CorePrep/H1Nester' - version: '4.006' - - - class: Pod::Weaver::Plugin::SingleEncoding - name: '@Default/SingleEncoding' - version: '4.006' - - - class: Pod::Weaver::Section::Name - name: '@Default/Name' - version: '4.006' - - - class: Pod::Weaver::Section::Version - name: '@Default/Version' - version: '4.006' - - - class: Pod::Weaver::Section::Region - name: '@Default/prelude' - version: '4.006' - - - class: Pod::Weaver::Section::Generic - name: SYNOPSIS - version: '4.006' - - - class: Pod::Weaver::Section::Generic - name: DESCRIPTION - version: '4.006' - - - class: Pod::Weaver::Section::Generic - name: OVERVIEW - version: '4.006' - - - class: Pod::Weaver::Section::Collect - name: ATTRIBUTES - version: '4.006' - - - class: Pod::Weaver::Section::Collect - name: METHODS - version: '4.006' - - - class: Pod::Weaver::Section::Collect - name: FUNCTIONS - version: '4.006' - - - class: Pod::Weaver::Section::Leftovers - name: '@Default/Leftovers' - version: '4.006' - - - class: Pod::Weaver::Section::Region - name: '@Default/postlude' - version: '4.006' - - - class: Pod::Weaver::Section::Authors - name: '@Default/Authors' - version: '4.006' - - - class: Pod::Weaver::Section::Legal - name: '@Default/Legal' - version: '4.006' - name: '@DOY/PodWeaver' - version: '4.005' - - - class: Dist::Zilla::Plugin::UploadToCPAN - name: '@DOY/UploadToCPAN' - version: '5.014' - - - class: Dist::Zilla::Plugin::AutoPrereqs - name: AutoPrereqs - version: '5.014' - - - class: Dist::Zilla::Plugin::ContributorsFromGit - name: ContributorsFromGit - version: '0.006' - - - class: Dist::Zilla::Plugin::Prereqs - config: - Dist::Zilla::Plugin::Prereqs: - phase: develop - type: requires - name: DevelopRequires - version: '5.014' - - - class: Dist::Zilla::Plugin::FinderCode - name: ':InstallModules' - version: '5.014' - - - class: Dist::Zilla::Plugin::FinderCode - name: ':IncModules' - version: '5.014' - - - class: Dist::Zilla::Plugin::FinderCode - name: ':TestFiles' - version: '5.014' - - - class: Dist::Zilla::Plugin::FinderCode - name: ':ExecFiles' - version: '5.014' - - - class: Dist::Zilla::Plugin::FinderCode - name: ':ShareFiles' - version: '5.014' - - - class: Dist::Zilla::Plugin::FinderCode - name: ':MainModule' - version: '5.014' - - - class: Dist::Zilla::Plugin::FinderCode - name: ':AllFiles' - version: '5.014' - - - class: Dist::Zilla::Plugin::FinderCode - name: ':NoFiles' - version: '5.014' - - - class: Dist::Zilla::Plugin::FinderCode - name: '@DOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM' - version: '5.014' - zilla: - class: Dist::Zilla::Dist::Builder - config: - is_trial: '0' - version: '5.014' + homepage: https://github.com/stevan/BreadBoard + repository: https://github.com/stevan/BreadBoard.git +version: '0.37' x_authority: cpan:STEVAN +x_contributor_covenant: + version: 0.01 x_contributors: + - 'Alex Balhatchet ' - 'André Walker ' + - 'ben hengst ' - 'Brad Bowman ' - 'Caleb Cushing ' - 'Daisuke Maki ' + - 'Dave Rolsky ' - 'Florian Ragwitz ' - 'Gabor Szabo ' - 'Gianni Ceccarelli ' + - 'Graham Knop ' - 'Jason Galea ' - 'Jason May ' - 'Jay Hannah ' - 'Jesse Luehrs ' - 'Jonathan Rockway ' - 'Kip Hampton ' + - 'Mohammad S Anwar ' - 'Neil Bowers ' - 'Philippe Bruhat (BooK) ' - 'Sterling Hanenkamp ' - 'Tomas Doran ' - - 'ben hengst ' + - 'Yanick Champoux ' + - 'Yanick Champoux ' - 'zdk ' +x_generated_by_perl: v5.20.2 +x_serialization_backend: 'YAML::Tiny version 1.67' diff -Nru libbread-board-perl-0.32/README libbread-board-perl-0.37/README --- libbread-board-perl-0.32/README 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ - - -This archive contains the distribution Bread-Board, -version 0.32: - - A solderless way to wire up your application components - -This software is copyright (c) 2014 by Infinity Interactive. - -This is free software; you can redistribute it and/or modify it under -the same terms as the Perl 5 programming language system itself. - - -This README file was generated by Dist::Zilla::Plugin::Readme v5.014. - diff -Nru libbread-board-perl-0.32/README.mkdn libbread-board-perl-0.37/README.mkdn --- libbread-board-perl-0.32/README.mkdn 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/README.mkdn 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,568 @@ +# NAME + +Bread::Board - A solderless way to wire up your application components + +# VERSION + +version 0.37 + +# SYNOPSIS + +```perl +use Bread::Board; + +my $c = container 'MyApp' => as { + + service 'log_file_name' => "logfile.log"; + + service 'logger' => ( + class => 'FileLogger', + lifecycle => 'Singleton', + dependencies => [ 'log_file_name' ], + ); + + container 'Database' => as { + service 'dsn' => "dbi:SQLite:dbname=my-app.db"; + service 'username' => "user234"; + service 'password' => "****"; + + service 'dbh' => ( + block => sub { + my $s = shift; + require DBI; + DBI->connect( + $s->param('dsn'), + $s->param('username'), + $s->param('password'), + ) || die "Could not connect"; + }, + dependencies => [ 'dsn', 'username', 'password' ] + ); + }; + + service 'application' => ( + class => 'MyApplication', + dependencies => { + logger => 'logger', + dbh => 'Database/dbh', + } + ); + +}; + +no Bread::Board; # removes keywords + +# get an instance of MyApplication +# from the container +my $app = $c->resolve( service => 'application' ); + +# now user your MyApplication +# as you normally would ... +$app->run; +``` + +# DESCRIPTION + +Bread::Board is an inversion of control framework with a focus on +dependency injection and lifecycle management. It's goal is to +help you write more decoupled objects and components by removing +the need for you to manually wire those objects/components together. + +Want to know more? See the [Bread::Board::Manual](https://metacpan.org/pod/Bread::Board::Manual). + +``` ++-----------------------------------------+ +| A B C D E F G H I J | +|-----------------------------------------| +| o o | 1 o-o-o-o-o v o-o-o-o-o 1 | o o | +| o o | 2 o-o-o-o-o o-o-o-o-o 2 | o o | +| o o | 3 o-o-o-o-o o-o-o-o-o 3 | o o | +| o o | 4 o-o-o-o-o o-o-o-o-o 4 | o o | +| o o | 5 o-o-o-o-o o-o-o-o-o 5 | o o | +| | 6 o-o-o-o-o o-o-o-o-o 6 | | +| o o | 7 o-o-o-o-o o-o-o-o-o 7 | o o | +| o o | 8 o-o-o-o-o o-o-o-o-o 8 | o o | +| o o | 9 o-o-o-o-o o-o-o-o-o 9 | o o | +| o o | 10 o-o-o-o-o o-o-o-o-o 10 | o o | +| o o | 11 o-o-o-o-o o-o-o-o-o 11 | o o | +| | 12 o-o-o-o-o o-o-o-o-o 12 | | +| o o | 13 o-o-o-o-o o-o-o-o-o 13 | o o | +| o o | 14 o-o-o-o-o o-o-o-o-o 14 | o o | +| o o | 15 o-o-o-o-o o-o-o-o-o 15 | o o | +| o o | 16 o-o-o-o-o o-o-o-o-o 16 | o o | +| o o | 17 o-o-o-o-o o-o-o-o-o 17 | o o | +| | 18 o-o-o-o-o o-o-o-o-o 18 | | +| o o | 19 o-o-o-o-o o-o-o-o-o 19 | o o | +| o o | 20 o-o-o-o-o o-o-o-o-o 20 | o o | +| o o | 21 o-o-o-o-o o-o-o-o-o 21 | o o | +| o o | 22 o-o-o-o-o o-o-o-o-o 22 | o o | +| o o | 22 o-o-o-o-o o-o-o-o-o 22 | o o | +| | 23 o-o-o-o-o o-o-o-o-o 23 | | +| o o | 24 o-o-o-o-o o-o-o-o-o 24 | o o | +| o o | 25 o-o-o-o-o o-o-o-o-o 25 | o o | +| o o | 26 o-o-o-o-o o-o-o-o-o 26 | o o | +| o o | 27 o-o-o-o-o o-o-o-o-o 27 | o o | +| o o | 28 o-o-o-o-o ^ o-o-o-o-o 28 | o o | ++-----------------------------------------+ +``` + +Loading this package will automatically load the rest of the packages needed by +your Bread::Board configuration. + +# EXPORTED FUNCTIONS + +The functions of this package provide syntactic sugar to help you build your +Bread::Board configuration. You can build such a configuration by constructing +the objects manually instead, but your code may be more difficult to +understand. + +## `container` + +### simple case + +``` +container $name, \&body; +``` + +This function constructs and returns an instance of [Bread::Board::Container](https://metacpan.org/pod/Bread::Board::Container). +The (optional) `&body` block may be used to add services or sub-containers +within the newly constructed container. Usually, the block is not passed +directly, but passed using the `as` function. + +For example, + +```perl +container 'MyWebApp' => as { + service my_dispatcher => ( + class => 'MyWebApp::Dispatcher', + ); +}; +``` + +If `$name` starts with `'+'`, and the container is being declared inside +another container, then this declaration will instead extend an existing +container with the name `$name` (without the `'+'`). + +### from an instance + +``` +container $container_instance, \&body +``` + +In many cases, subclassing [Bread::Board::Container](https://metacpan.org/pod/Bread::Board::Container) is the easiest route to +getting access to this framework. You can do this and still get all the +benefits of the syntactic sugar for configuring that class by passing an +instance of your container subclass to `container`. + +You could, for example, configure your container inside the `BUILD` method of +your class: + +```perl +package MyWebApp; +use Moose; + +extends 'Bread::Board::Container'; + +sub BUILD { + my $self = shift; + + container $self => as { + service dbh => ( ... ); + }; +} +``` + +### with parameters + +``` +container $name, \@parameters, \&body +``` + +A third way of using the `container` function is to build a parameterized +container. These are useful as a way of providing a placeholder for parts of +the configuration that may be provided later. You may not use an instance +object in place of the `$name` in this case. + +For more detail on how you might use parameterized containers, see +["Parameterized Containers" in Bread::Board::Manual::Concepts::Advanced](https://metacpan.org/pod/Bread::Board::Manual::Concepts::Advanced#Parameterized-Containers). + +## `as` + +``` +as { some_code() }; +``` + +This is just a replacement for the `sub` keyword that is easier to read when +defining containers. + +## `service` + +``` +service $name, $literal; +service $name, %service_description; +``` + +Within the `as` blocks for your containers, you may construct services using +the `service` function. This can construct several different kinds of services +based upon how it is called. + +### literal services + +To build a literal service (a [Bread::Board::Literal](https://metacpan.org/pod/Bread::Board::Literal) object), just specify a +scalar value or reference you want to use as the literal value: + +```perl +# In case you need to adjust the gravitational constant of the Universe +service gravitational_constant => 6.673E-11; +``` + +### using injections + +To build a service using one of the injection services, just fill in all the +details required to use that sort of injection: + +```perl +service search_service => ( + class => 'MyApp::Search', + block => sub { + my $s = shift; + MyApp::Search->new($s->param('url'), $s->param('type')); + }, + dependencies => { + url => 'search_url', + }, + parameters => { + type => { isa => 'Str', default => 'text' }, + }, +); +``` + +The type of injection performed depends on the parameters used. You may use +the `service_class` parameter to pick a specific injector class. For +instance, this is useful if you need to use [Bread::Board::SetterInjection](https://metacpan.org/pod/Bread::Board::SetterInjection) +or have defined a custom injection service. If you specify a `block`, block +injection will be performed using [Bread::Board::BlockInjection](https://metacpan.org/pod/Bread::Board::BlockInjection). If neither +of these is present, constructor injection will be used with +[Bread::Board::ConstructorInjection](https://metacpan.org/pod/Bread::Board::ConstructorInjection) (and you must provide the `class` +option). + +### service dependencies + +The `dependencies` parameter takes a hashref of dependency names mapped to +[Bread::Board::Dependency](https://metacpan.org/pod/Bread::Board::Dependency) objects, but there are several coercions and sugar +functions available to make specifying dependencies as easy as possible. The +simplest case is when the names of the services you're depending on are the +same as the names that the service you're defining will be accessing them with. +In this case, you can just specify an arrayref of service names: + +```perl +service foo => ( + dependencies => [ 'bar', 'baz' ], + # ... +); +``` + +If you need to use a different name, you can specify the dependencies as a +hashref instead: + +```perl +service foo => ( + dependencies => { + dbh => 'foo_dbh', + }, + # ... +); +``` + +You can also specify parameters when depending on a parameterized service: + +```perl +service foo => ( + dependencies => [ + { bar => { bar_param => 1 } }, + 'baz', + ], + # ... +); +``` + +Finally, services themselves can also be specified as dependencies, in which +case they will just be resolved directly: + +```perl +service foo => ( + dependencies => { + dsn => Bread::Board::Literal->new( + name => 'dsn', + value => 'dbi:mysql:mydb', + ), + }, + # ... +); +``` + +As a special case, an arrayref of dependencies will be interpreted as a service +which returns an arrayref containing the resolved values of those dependencies: + +```perl +service foo => ( + dependencies => { + # items will resolve to [ $bar_service->get, $baz_service->get ] + items => [ + 'bar', + Bread::Board::Literal->new(name => 'baz', value => 'BAZ'), + ], + }, + # ... +); +``` + +### inheriting and extending services + +If the `$name` starts with a `'+'`, the service definition will instead +extend an existing service with the given `$name` (without the `'+'`). This +works similarly to the `has '+foo'` syntax in Moose. It is most useful when +defining a container class where the container is built up in `BUILD` methods, +as each class in the inheritance hierarchy can modify services defined in +superclasses. The `dependencies` and `parameters` options will be merged with +the existing values, rather than overridden. Note that literal services can't +be extended, because there's nothing to extend. You can still override them +entirely by declaring the service name without a leading `'+'`. + +## `literal` + +``` +literal($value); +``` + +Creates an anonymous [Bread::Board::Literal](https://metacpan.org/pod/Bread::Board::Literal) object with the given value. + +```perl + service 'dbh' => ( + block => sub { + my $s = shift; + require DBI; + DBI->connect( + $s->param('dsn'), + $s->param('username'), + $s->param('password'), + ) || die "Could not connect"; + }, + dependencies => { + dsn => literal 'dbi:SQLite:somedb', + username => literal 'foo', + password => literal 'password', + + }, + ); +``` + +## `depends_on` + +``` +depends_on($service_path); +``` + +The `depends_on` function creates a [Bread::Board::Dependency](https://metacpan.org/pod/Bread::Board::Dependency) object for the +named `$service_path` and returns it. + +## `wire_names` + +``` +wire_names(@service_names); +``` + +This function is just a shortcut for passing a hash reference of dependencies +into the service. It is not typically needed, since Bread::Board can usually +understand what you mean - these declarations are all equivalent: + +```perl +service foo => ( + class => 'Pity::TheFoo', + dependencies => { + foo => depends_on('foo'), + bar => depends_on('bar'), + baz => depends_on('baz'), + }, +); + +service foo => ( + class => 'Pity::TheFoo', + dependencies => wire_names(qw( foo bar baz )), +); + +service foo => ( + class => 'Pity::TheFoo', + dependencies => { + foo => 'foo', + bar => 'bar', + baz => 'baz', + }, +); + +service foo => ( + class => 'Pity::TheFoo', + dependencies => [ qw(foo bar baz ) ], +); +``` + +## `typemap` + +``` +typemap $type, $service; +typemap $type, $service_path; +``` + +This creates a type mapping for the named type. Typically, it is paired with +the `infer` call like so: + +```perl +typemap 'MyApp::Model::UserAccount' => infer; +``` + +For more details on what type mapping is and how it works, see +[Bread::Board::Manual::Concepts::Typemap](https://metacpan.org/pod/Bread::Board::Manual::Concepts::Typemap). + +## `infer` + +``` +infer; +infer(%hints); +``` + +This is used with `typemap` to help create the typemap inference. It can be +used with no arguments to do everything automatically. However, in some cases, +you may want to pass a service instance as the argument or a hash of service +arguments to change how the type map works. For example, if your type needs to +be constructed using a setter injection, you can use an inference similar to +this: + +```perl +typemap 'MyApp::Model::UserPassword' => infer( + service_class => 'Bread::Board::SetterInjection', +); +``` + +For more details on what type mapping is and how it works, see +[Bread::Board::Manual::Concepts::Typemap](https://metacpan.org/pod/Bread::Board::Manual::Concepts::Typemap). + +## `include` + +``` +include $file; +``` + +This is a shortcut for loading a Bread::Board configuration from another file. + +``` +include "filename.pl"; +``` + +The above is pretty much identical to running: + +``` +do "filename.pl"; +``` + +However, you might find it more readable to use `include`. + +## `alias` + +``` +alias $service_name, $service_path, %service_description; +``` + +This helper allows for the creation of [service +aliases](https://metacpan.org/pod/Bread::Board::Service::Alias), which allows you to define a +service in one place and then reuse that service with a different name +somewhere else. This is sort of like a symbolic link for +services. Aliases will be [resolved +recursively](https://metacpan.org/pod/Bread::Board::Traversable#fetch), so an alias can alias an +alias. + +For example, + +```perl +service file_logger => ( + class => 'MyApp::Logger::File', +); + +alias my_logger => 'file_logger'; +``` + +# OTHER FUNCTIONS + +These are not exported, but might be helpful to you. + +## `set_root_container` + +``` +set_root_container $container; +``` + +You may use this to set a top-level root container for all container +definitions. + +For example, + +```perl +my $app = container MyApp => as { ... }; + +Bread::Board::set_root_container($app); + +my $config = container Config => as { ... }; +``` + +Here the `$config` container would be created as a sub-container of `$app`. + +# ACKNOWLEDGEMENTS + +Thanks to Daisuke Maki for his contributions and for really +pushing the development of this module along. + +Chuck "sprongie" Adams, for testing/using early (pre-release) +versions of this module, and some good suggestions for naming +it. + +Matt "mst" Trout, for finally coming up with the best name +for this module. + +Gianni "dakkar" Ceccarelli for writing lots of documentation, and +Net-a-Porter.com for paying his salary while he was doing it. + +# ARTICLES + +[Bread::Board is the right tool for this job](http://domm.plix.at/perl/2013_04_bread_board_is_the_right_rool_for_this_job.html) +Thomas Klausner showing a use-case for Bread::Board. + +# SEE ALSO + +- [Bread::Board::Declare](https://metacpan.org/pod/Bread::Board::Declare) + + This provides more powerful syntax for writing Bread::Board container classes. + +- [IOC](https://metacpan.org/pod/IOC) + + Bread::Board is basically my re-write of IOC. + +- [http://en.wikipedia.org/wiki/Breadboard](http://en.wikipedia.org/wiki/Breadboard) + +# AUTHOR + +Stevan Little + +# BUGS + +Please report any bugs or feature requests on the bugtracker website +https://github.com/stevan/BreadBoard/issues + +When submitting a bug or request, please include a test-file or a +patch to an existing test-file that illustrates the bug or desired +feature. + +# COPYRIGHT AND LICENSE + +This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. diff -Nru libbread-board-perl-0.32/SIGNATURE libbread-board-perl-0.37/SIGNATURE --- libbread-board-perl-0.32/SIGNATURE 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/SIGNATURE 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,138 @@ +This file contains message digests of all files listed in MANIFEST, +signed via the Module::Signature module, version 0.79. + +To verify the content in this distribution, first make sure you have +Module::Signature installed, then type: + + % cpansign -v + +It will check each file's integrity, as well as the signature's +validity. If "==> Signature verified OK! <==" is not displayed, +the distribution may already have been compromised, and you should +not run its Makefile.PL or Build.PL. + +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +SHA1 7882559bbba283ac45290013abccc5c496e39e60 CODE_OF_CONDUCT.md +SHA1 99687ee97adb7366b090052a9ad0ec2f53546f6b CONTRIBUTORS +SHA1 ed276811111f0a6ec170857d511ea7fb2ff6ffe2 Changes +SHA1 126b3991e8ebf99ecd0bd3934ee1a7765611ed6d INSTALL +SHA1 cceccfa33c74ada8305d1c8d5384a4bc4d4ee483 LICENSE +SHA1 17d3099d2bd43cba9143195b8da689c46073c125 MANIFEST +SHA1 2e3e81c3faf2ba3066b58b1233092e6baaf0197a META.json +SHA1 5085e94699661b72d9dd1bc6d510c2629804b91c META.yml +SHA1 5453be8c45db127bdc43709105ff68379b9eb3d5 Makefile.PL +SHA1 1fcf7f9a0ad31db6d5e069d065fd9e6263c308bf README.mkdn +SHA1 cb0124cd9c5e96cfc6427e232abc73bc9d7515de cpanfile +SHA1 ccc3175c2c919f000c6ab4c174a2a623014b76a2 doap.xml +SHA1 d7e5a2edec446269d8e09c575c149ce8c9fa6c24 lib/Bread/Board.pm +SHA1 8d6b6ee8000a1707bd9f430cd8f6f93a891185fa lib/Bread/Board/BlockInjection.pm +SHA1 d2d1ed462a601a892f143d44f172646f0000e805 lib/Bread/Board/ConstructorInjection.pm +SHA1 2be2832213c4956106bfbc599a52350ddde18a33 lib/Bread/Board/Container.pm +SHA1 8dc8ee7ccb3c250cd6fbde35fa6720a620659f56 lib/Bread/Board/Container/FromParameterized.pm +SHA1 c2fc38529343707355e641b60aca094dd2544bfc lib/Bread/Board/Container/Parameterized.pm +SHA1 50e433b00b8e2bca002ad1e16216cb90d9317939 lib/Bread/Board/Dependency.pm +SHA1 429d1412e7ae713a841d0e3248b283d195919b7c lib/Bread/Board/Dumper.pm +SHA1 5b8c410134cf72705c90787dba8cd3bfee9ac36a lib/Bread/Board/LifeCycle.pm +SHA1 eed1ebca34995c75223f71d89ace5ee37dec50f0 lib/Bread/Board/LifeCycle/Singleton.pm +SHA1 6b0a4f0fd9ca41bc9ed7d6053bc1c94b3256cf3d lib/Bread/Board/LifeCycle/Singleton/WithParameters.pm +SHA1 00fa93c74ffb4e0b09bce5d4cc196d37dba1108a lib/Bread/Board/Literal.pm +SHA1 7561bff4d35f0c3a36f8cdfe20dbe1a1429cc8b3 lib/Bread/Board/Manual.pod +SHA1 71e1a068cd006a707f7f8bd3123ad14ff8b75fc3 lib/Bread/Board/Manual/Concepts.pod +SHA1 e1a7961a5a1860804277e93e64743bd83c8c2750 lib/Bread/Board/Manual/Concepts/Advanced.pod +SHA1 6114183100e93f08620919c55ab2d5dadb894fc2 lib/Bread/Board/Manual/Concepts/Typemap.pod +SHA1 f79f6970f559f6741cf303ada482d4ceed65bf09 lib/Bread/Board/Manual/Example.pod +SHA1 3f2bce510493eed686a98b928e757cada8f77720 lib/Bread/Board/Manual/Example/FormSensible.pod +SHA1 2986b9851dd4fabe055081edb29a2e347349f158 lib/Bread/Board/Manual/Example/LogDispatch.pod +SHA1 bdb4578d5b0b4a486e4d4ebbac927163abd31cff lib/Bread/Board/Service.pm +SHA1 05f69a659e2cb819221552cde6549be8965056db lib/Bread/Board/Service/Alias.pm +SHA1 dc911ccd9275f58b47fee91aea96061364a8f0db lib/Bread/Board/Service/Deferred.pm +SHA1 214743784a92cb588e6c408f4f6b5921e8144c93 lib/Bread/Board/Service/Deferred/Thunk.pm +SHA1 43db87459d883b692cf901353c8b86c1d7d724da lib/Bread/Board/Service/Inferred.pm +SHA1 508ab0189038a423b8fa580ed1210e30b59c5c24 lib/Bread/Board/Service/WithClass.pm +SHA1 aefde131dfb098c565b777ce8d6236c00a3026db lib/Bread/Board/Service/WithConstructor.pm +SHA1 edd7fb410d7db7953d5e34f39b25614884756227 lib/Bread/Board/Service/WithDependencies.pm +SHA1 0496d1c01f25ba7460b4d1006fbc792783f9f4be lib/Bread/Board/Service/WithParameters.pm +SHA1 3af51c47a03553526a051ae968865cb0d97dc2ea lib/Bread/Board/SetterInjection.pm +SHA1 30cd7701e98fae1418bd78cb9adc6ed18f6e0370 lib/Bread/Board/Traversable.pm +SHA1 89bd20d909643af48d4716a66e7f4dde8a32d024 lib/Bread/Board/Types.pm +SHA1 750ff38befd1bf8d67708c96c68e76555a56aeaa t/00-compile.t +SHA1 b827b18eeb9c867b27ec709379b2f4e6a72d8fd2 t/00-report-prereqs.dd +SHA1 6348689eee69681210251892bd47cbfbb7507d7d t/00-report-prereqs.t +SHA1 751103232b9b8d9eb5918981341b70790fa729bb t/001_constructor_injection.t +SHA1 1e980d97aa4bdba035ab3c83fa9b7feeae51b0b5 t/002_setter_injection.t +SHA1 7868c26adf3b85f959a8104f774793e4fb351a36 t/003_block_injection.t +SHA1 b4265c471a295b29f2fc2195535a74b87ecf0551 t/004_block_injection_w_out_class.t +SHA1 6ac17c39a66553d5afe7c53ea9ae9b8c08dc1012 t/005_alias.t +SHA1 3f1171fe7ee0e8d6cd4f651e6637c7a8ee210c10 t/010_container.t +SHA1 37695ff39a7466d273c6c95480578a23d6c5035b t/011_container_path.t +SHA1 7ac20cccf542a528270a511e61595e6530a4dc67 t/012_container_with_shared_deps.t +SHA1 bbdf1958d2c8fcc1608129695fb735b41199901d t/020_sugar.t +SHA1 a770d2f329c496f727e727a789955ba2e7b4066c t/021_sugar.t +SHA1 0115e49fd48956e1923f36d598a597f00f98b480 t/022_sugar.t +SHA1 7383ec6072a7746b1980c2582d9bea50b9d18573 t/023_sugar.t +SHA1 52f923f33dcaae6bac8a36857651f1f4a5632a91 t/024_sugar.t +SHA1 55c0708edc83699089a91e3d2dd521385d19b2a6 t/025_sugar_w_absolute_path.t +SHA1 2a540a326de81835d0c6dd9334c71c811d4d5d2e t/026_sugar_remove.t +SHA1 64188a7ccbdf163cfcaf58a6b3eba8c62571f58d t/027_sugar_w_include.t +SHA1 3b7004f0767d87977b8073df829e01e2138b660e t/028_sugar_w_recursive_inc.t +SHA1 4293e122dbfa0dc9f0f77d9136923d6f2e9e7aaf t/029_sugar_auto_wire_names.t +SHA1 f23222b8b99f677bdd51dd69e1c02830c9ae3ed1 t/030_lifecycle_singleton.t +SHA1 922e35cd63174a3b61a8bbd52ed4dbadb7c3c5b8 t/031_custom_lifecycles.t +SHA1 08c19a45d093aa604e58accc4d49e558490a8d44 t/032_singleton_cycle.t +SHA1 5bd8711110602d8b70e17f418f768f81c7f4f1c6 t/040_circular_dependencies.t +SHA1 bdcc19628732e781aa784540b6e9a64f4fa577ed t/041_parameter_cache_handling.t +SHA1 1112ea7072af6e45446fbdef90f92122e3243db0 t/042_parameter_cache_with_singleton.t +SHA1 8d0f9b9b3040f3ed3504d605d4987f7e9d821f99 t/043_parameter_leaks.t +SHA1 1a322883da6dc77d4e8a7c435a51fd5cc3e0a0ff t/044_deferred_parameters.t +SHA1 b12d120ae02005ba35e9d27624d13e86bfd177c4 t/045_parameters_in_dependency.t +SHA1 9b034977fc02e9c0839dedae940869d49fdb1f07 t/046_custom_parameter_service.t +SHA1 b070caf996694e7e7a30e2034eb58b075e4396c6 t/047_dependencies_override_parameters.t +SHA1 c3fbef146dd0cb4e2b950f4b64a444d77c72ffb9 t/048_array_deps.t +SHA1 a08571dd7fe6209957cc9b42c8caaf5be299301e t/050_parameterized_containers.t +SHA1 e703a7feb5f9fc0378ca071cd6deacad98545287 t/051_more_parameterized_containers.t +SHA1 e150d7901aae99d921b108c69ae76626d19282dc t/052_parameterized_in_hierarchy.t +SHA1 aafa31e05d4566ed9ac7221bb29ae14b03900ad7 t/053_parameterized_clone.t +SHA1 6c600e0ec344a06a4ba8bf0e298512aff42c8481 t/054_parameterized_backref.t +SHA1 de90eac1dd7f192b72d8ffb220b644259ce895b0 t/060_extend_w_sugar.t +SHA1 3fd84c5cee4396db778672bd5c77caa8053b8893 t/061_extends_w_sugar_and_inheritance.t +SHA1 bbd8ff59c278a92b02a31ad8b9489d73de62328a t/062_service_class_w_sugar.t +SHA1 12b0f79c551522f3e3fd6ac440d23948b1260b4b t/070_with_basic_typemap.t +SHA1 72ae6d23b2bbbef492cea5b78af4ba717a3152b0 t/071_typemap_with_basic_infer.t +SHA1 fcbd1bb111509c471420901f1399327ac2f35396 t/072_typemap_with_more_infer.t +SHA1 24b1f72ed8e9aa3a59a23b1c486a7a118bb78a6d t/073_typemap_with_role_infer.t +SHA1 2de1f3670a3be68cca59325d0b8a257a40561418 t/074_typemap_w_recursive_infer.t +SHA1 14267b699d900ec9d6ac9a61e41f31d138780105 t/075_complex_typemap_example.t +SHA1 e65e08ce2aa8e6d8127c46db7a9abef24b6880a8 t/076_more_complex_typemap.t +SHA1 afda47d7b06806913a46de7f0c1a1121bc5a6fb8 t/077_more_complex_typemap_w_roles.t +SHA1 429e80736f12e9a39564832e7e6064b944a2025f t/078_complex_typemap_w_error.t +SHA1 01e0c90944205b48c72fe474822a388f393b77ee t/079_depending_on_type.t +SHA1 1b5b6303ded514dfce966f1746876e84a9f7e861 t/080_infer_subclasses.t +SHA1 58b82465814d8f6ebfa130cfea855af25cebcd96 t/100_clone_w_constructor_injection.t +SHA1 32c6ce14d89439aefe7abf70530bf13308096cf4 t/101_clone_w_setter_injection.t +SHA1 b8d57052d9872f91ac3ec3b26ff75575c561aa23 t/102_clone_w_block_injection.t +SHA1 e636efbbd94211838ff25b9f2220b7f41d79d6dc t/110_clone_w_singleton.t +SHA1 acceb11f1aa5176f06fc2321d18812bf2d022124 t/150_deferred_parameters_fail.t +SHA1 ddb7acd4285f069e37424a30edac2a10968f7f69 t/151_sugar_no_container.t +SHA1 856fcf40f418b9dbc7b77b086fec5873297bbd80 t/152_sugar_service_inheritance.t +SHA1 845bb96d3876c4abe15e7a6844b54152c3056795 t/153_sugar_container_inheritance.t +SHA1 32fd1ebfdaa14aa3effb5b649c19d188ecd18be8 t/200_example_code.t +SHA1 32f8035e381bc3a4711ca30d472dee665f487084 t/201_log_dispatch_example.t +SHA1 85f4ba29c828ae6cadedf60d2710a04ef38d6984 t/202_form_sensible_example.t +SHA1 c36904adc649abfc2544c3f04fa8cd9a20e2f838 t/300_no_new.t +SHA1 ed942f8f06034dc7a16b87b6e6dfb0bd598c7aaf t/301_sugar.t +SHA1 56996a79c526cd7759b153275cc315b7df26dc70 t/302_path_traversal_deprecation.t +SHA1 df1416e4b62108c5085ce11e8d1a9387a2490952 t/310_literal_keyword.t +SHA1 d9e2c050ee0bbf915711fad435f2e3608d12b361 t/500-gh61.t +SHA1 5b22f42755e60f9eae74f624b252f0b5f168f980 t/lib/bad.bb +SHA1 cd82998b7b796280f4fa50bae8a77c2d6a4ad004 t/lib/false.bb +SHA1 ec62b218160c4f116cb0d0966d6eef39eae9d701 t/lib/logger.bb +SHA1 dd10457eebda57a6f9aa89ee9a3d1e67a7298cfc t/lib/my_app.bb +SHA1 d1fe7d94b3edc7847eb187d4ee41f66e19cf8907 xt/release/unused-vars.t +-----BEGIN PGP SIGNATURE----- + +iEYEARECAAYFAl0WoJoACgkQ34Hwf+GwC4z8swCgoQ9+QVlGBHsn+Zd6hS4ILBjJ +uvgAn0pkCex4yuD9a/tW7xIm+6LBkDXW +=k9Kt +-----END PGP SIGNATURE----- diff -Nru libbread-board-perl-0.32/t/002_setter_injection.t libbread-board-perl-0.37/t/002_setter_injection.t --- libbread-board-perl-0.32/t/002_setter_injection.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/t/002_setter_injection.t 2019-06-28 23:19:54.000000000 +0000 @@ -20,9 +20,12 @@ package Addict; use Moose; + sub shoot_up_good { shift->new(@_, overdose => 1) } + has 'needle' => (is => 'rw'); has 'spoon' => (is => 'rw'); has 'stash' => (is => 'rw'); + has 'overdose' => (is => 'ro', isa => 'Bool', default => 0); } my $s = Bread::Board::SetterInjection->new( @@ -57,6 +60,15 @@ } } +$s->constructor_name('shoot_up_good'); + +{ + my $i = $s->get(stash => Mexican::Black::Tar->new); + + isa_ok($i, 'Addict'); + ok $i->overdose, 'Alternate constructor called'; +} + is($s->name, 'William', '... got the right name'); is($s->class, 'Addict', '... got the right class'); diff -Nru libbread-board-perl-0.32/t/00-compile.t libbread-board-perl-0.37/t/00-compile.t --- libbread-board-perl-0.32/t/00-compile.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/t/00-compile.t 2019-06-28 23:19:54.000000000 +0000 @@ -2,11 +2,11 @@ use strict; use warnings; -# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.039 - -use Test::More tests => 23 + ($ENV{AUTHOR_TESTING} ? 1 : 0); +# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.052 +use Test::More; +plan tests => 24 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Bread/Board.pm', @@ -27,6 +27,7 @@ 'Bread/Board/Service/Deferred/Thunk.pm', 'Bread/Board/Service/Inferred.pm', 'Bread/Board/Service/WithClass.pm', + 'Bread/Board/Service/WithConstructor.pm', 'Bread/Board/Service/WithDependencies.pm', 'Bread/Board/Service/WithParameters.pm', 'Bread/Board/SetterInjection.pm', @@ -67,6 +68,7 @@ -is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING}; +is(scalar(@warnings), 0, 'no warnings found') + or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; diff -Nru libbread-board-perl-0.32/t/00-report-prereqs.dd libbread-board-perl-0.37/t/00-report-prereqs.dd --- libbread-board-perl-0.32/t/00-report-prereqs.dd 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/t/00-report-prereqs.dd 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,50 @@ +do { my $x = { + 'configure' => { + 'requires' => { + 'ExtUtils::MakeMaker' => '0' + } + }, + 'develop' => { + 'requires' => { + 'Test::More' => '0.96', + 'Test::Vars' => '0' + } + }, + 'runtime' => { + 'requires' => { + 'Carp' => '0', + 'Module::Runtime' => '0', + 'Moose' => '0', + 'Moose::Exporter' => '2.1200', + 'Moose::Role' => '0', + 'Moose::Util' => '0', + 'Moose::Util::TypeConstraints' => '0', + 'MooseX::Clone' => '0.05', + 'MooseX::Params::Validate' => '0.14', + 'Scalar::Util' => '0', + 'Try::Tiny' => '0', + 'overload' => '0', + 'strict' => '0', + 'warnings' => '0' + } + }, + 'test' => { + 'recommends' => { + 'CPAN::Meta' => '2.120900' + }, + 'requires' => { + 'ExtUtils::MakeMaker' => '0', + 'File::Spec' => '0', + 'FindBin' => '0', + 'IO::Handle' => '0', + 'IPC::Open3' => '0', + 'Test::Fatal' => '0', + 'Test::Moose' => '0', + 'Test::More' => '0', + 'Test::Requires' => '0', + 'perl' => '5.006' + } + } + }; + $x; + } \ No newline at end of file diff -Nru libbread-board-perl-0.32/t/00-report-prereqs.t libbread-board-perl-0.37/t/00-report-prereqs.t --- libbread-board-perl-0.32/t/00-report-prereqs.t 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/t/00-report-prereqs.t 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,193 @@ +#!perl + +use strict; +use warnings; + +# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027 + +use Test::More tests => 1; + +use ExtUtils::MakeMaker; +use File::Spec; + +# from $version::LAX +my $lax_version_re = + qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? + | + (?:\.[0-9]+) (?:_[0-9]+)? + ) | (?: + v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? + | + (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? + ) + )/x; + +# hide optional CPAN::Meta modules from prereq scanner +# and check if they are available +my $cpan_meta = "CPAN::Meta"; +my $cpan_meta_pre = "CPAN::Meta::Prereqs"; +my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic + +# Verify requirements? +my $DO_VERIFY_PREREQS = 1; + +sub _max { + my $max = shift; + $max = ( $_ > $max ) ? $_ : $max for @_; + return $max; +} + +sub _merge_prereqs { + my ($collector, $prereqs) = @_; + + # CPAN::Meta::Prereqs object + if (ref $collector eq $cpan_meta_pre) { + return $collector->with_merged_prereqs( + CPAN::Meta::Prereqs->new( $prereqs ) + ); + } + + # Raw hashrefs + for my $phase ( keys %$prereqs ) { + for my $type ( keys %{ $prereqs->{$phase} } ) { + for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { + $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; + } + } + } + + return $collector; +} + +my @include = qw( + +); + +my @exclude = qw( + +); + +# Add static prereqs to the included modules list +my $static_prereqs = do './t/00-report-prereqs.dd'; + +# Merge all prereqs (either with ::Prereqs or a hashref) +my $full_prereqs = _merge_prereqs( + ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), + $static_prereqs +); + +# Add dynamic prereqs to the included modules list (if we can) +my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; +my $cpan_meta_error; +if ( $source && $HAS_CPAN_META + && (my $meta = eval { CPAN::Meta->load_file($source) } ) +) { + $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); +} +else { + $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) + $source = 'static metadata'; +} + +my @full_reports; +my @dep_errors; +my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; + +# Add static includes into a fake section +for my $mod (@include) { + $req_hash->{other}{modules}{$mod} = 0; +} + +for my $phase ( qw(configure build test runtime develop other) ) { + next unless $req_hash->{$phase}; + next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); + + for my $type ( qw(requires recommends suggests conflicts modules) ) { + next unless $req_hash->{$phase}{$type}; + + my $title = ucfirst($phase).' '.ucfirst($type); + my @reports = [qw/Module Want Have/]; + + for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { + next if $mod eq 'perl'; + next if grep { $_ eq $mod } @exclude; + + my $file = $mod; + $file =~ s{::}{/}g; + $file .= ".pm"; + my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; + + my $want = $req_hash->{$phase}{$type}{$mod}; + $want = "undef" unless defined $want; + $want = "any" if !$want && $want == 0; + + my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; + + if ($prefix) { + my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); + $have = "undef" unless defined $have; + push @reports, [$mod, $want, $have]; + + if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { + if ( $have !~ /\A$lax_version_re\z/ ) { + push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; + } + elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { + push @dep_errors, "$mod version '$have' is not in required range '$want'"; + } + } + } + else { + push @reports, [$mod, $want, "missing"]; + + if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { + push @dep_errors, "$mod is not installed ($req_string)"; + } + } + } + + if ( @reports ) { + push @full_reports, "=== $title ===\n\n"; + + my $ml = _max( map { length $_->[0] } @reports ); + my $wl = _max( map { length $_->[1] } @reports ); + my $hl = _max( map { length $_->[2] } @reports ); + + if ($type eq 'modules') { + splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; + push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; + } + else { + splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; + push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; + } + + push @full_reports, "\n"; + } + } +} + +if ( @full_reports ) { + diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; +} + +if ( $cpan_meta_error || @dep_errors ) { + diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; +} + +if ( $cpan_meta_error ) { + my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; + diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; +} + +if ( @dep_errors ) { + diag join("\n", + "\nThe following REQUIRED prerequisites were not satisfied:\n", + @dep_errors, + "\n" + ); +} + +pass; + +# vim: ts=4 sts=4 sw=4 et: diff -Nru libbread-board-perl-0.32/t/024_sugar.t libbread-board-perl-0.37/t/024_sugar.t --- libbread-board-perl-0.32/t/024_sugar.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/t/024_sugar.t 2019-06-28 23:19:54.000000000 +0000 @@ -46,6 +46,7 @@ service 'dsn' => "dbi:sqlite:dbname=my-app.db"; service 'username' => "user"; service 'password' => "pass"; + service 'host' => undef; service 'dbh' => ( block => sub { @@ -78,6 +79,8 @@ is($c->fetch('logger/log_file')->service, $c->fetch('log_file'), '... got the right value'); is($c->fetch('logger/log_file')->get, 'logfile.log', '... got the right value'); +is($c->resolve( service => 'Database/host'), undef, '... service where value is undef'); + my $dbh = $c->resolve( service => 'Database/dbh' ); isa_ok($dbh, 'DBI'); diff -Nru libbread-board-perl-0.32/t/026_sugar_remove.t libbread-board-perl-0.37/t/026_sugar_remove.t --- libbread-board-perl-0.32/t/026_sugar_remove.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/t/026_sugar_remove.t 2019-06-28 23:19:54.000000000 +0000 @@ -8,11 +8,11 @@ use Bread::Board; -is(exception { container 'MyApp' => sub { "dummy" } }, undef); -is(exception { as { "Dummy" } }, undef); +is(exception { container 'MyApp' => sub { "dummy" } }, undef, 'container sugar does not throw exception'); +is(exception { as { "Dummy" } }, undef, 'as sugar does not throw exception'); is(exception { container 'MyApp' => as { service 'service1' => 'foo' }; -}, undef); +}, undef, 'as service sugar does not throw exception'); is(exception { container 'MyApp' => as { service 'service1' => 'foo'; @@ -21,7 +21,7 @@ dependencies => wire_names 'service1' ); } -}, undef); +}, undef, 'container, service and wire_names sugar does not throw exception'); is(exception { container 'MyApp' => as { service 'service1' => 'foo'; @@ -32,19 +32,19 @@ } ); } -}, undef); +}, undef, 'container, service, and depends_on sugar does not throw exception'); no Bread::Board; like(exception { container() }, - qr/^Undefined subroutine &main::container called/); + qr/^Undefined subroutine &main::container called/, 'container function does not exist without Bread::Board'); like(exception { as() }, - qr/^Undefined subroutine &main::as called/); + qr/^Undefined subroutine &main::as called/, 'as function does not exist without Bread::Board'); like(exception { service() }, - qr/^Undefined subroutine &main::service called/); + qr/^Undefined subroutine &main::service called/, 'service function does not exist without Bread::Board'); like(exception { depends_on() }, - qr/^Undefined subroutine &main::depends_on called/); + qr/^Undefined subroutine &main::depends_on called/, 'depends_on function does not exist without Bread::Board'); like(exception { wire_names() }, - qr/^Undefined subroutine &main::wire_names called/); + qr/^Undefined subroutine &main::wire_names called/, 'wire_names function does not exist without Bread::Board'); done_testing; diff -Nru libbread-board-perl-0.32/t/032_singleton_cycle.t libbread-board-perl-0.37/t/032_singleton_cycle.t --- libbread-board-perl-0.32/t/032_singleton_cycle.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/t/032_singleton_cycle.t 2019-06-28 23:19:54.000000000 +0000 @@ -48,7 +48,7 @@ ); }; -ok($c->resolve(service => 'bot')); -is($seen, 1, 'seen only once'); +ok($c->resolve(service => 'bot'), 'can resolve bot service'); +is($seen, 1, '... and it is seen only once'); done_testing; diff -Nru libbread-board-perl-0.32/t/047_dependencies_override_parameters.t libbread-board-perl-0.37/t/047_dependencies_override_parameters.t --- libbread-board-perl-0.32/t/047_dependencies_override_parameters.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/t/047_dependencies_override_parameters.t 2019-06-28 23:19:54.000000000 +0000 @@ -20,7 +20,7 @@ ); }; -is($c->resolve(service => 'foo'), 'A'); -is($c->resolve(service => 'foo', parameters => { a => 'B' }), 'B'); +is($c->resolve(service => 'foo'), 'A', 'can resolve foo service with its default dependency'); +is($c->resolve(service => 'foo', parameters => { a => 'B' }), 'B', 'can resolve foo service with a parameter overriding the default'); done_testing; diff -Nru libbread-board-perl-0.32/t/053_parameterized_clone.t libbread-board-perl-0.37/t/053_parameterized_clone.t --- libbread-board-perl-0.32/t/053_parameterized_clone.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/t/053_parameterized_clone.t 2019-06-28 23:19:54.000000000 +0000 @@ -26,11 +26,11 @@ }; }; -is $c->fetch('Bar')->create(Baz => $c->fetch('Bif'))->resolve(service => 'moo'), 42; +is $c->fetch('Bar')->create(Baz => $c->fetch('Bif'))->resolve(service => 'moo'), 42, 'container works as expected'; my $clone; -is exception { $clone = $c->clone }, undef; +is exception { $clone = $c->clone }, undef, 'cloning the container does not throw an exception'; -is $clone->fetch('Bar')->create(Baz => $clone->fetch('Bif'))->resolve(service => 'moo'), 42; +is $clone->fetch('Bar')->create(Baz => $clone->fetch('Bif'))->resolve(service => 'moo'), 42, 'clone behaves like the original'; done_testing; diff -Nru libbread-board-perl-0.32/t/054_parameterized_backref.t libbread-board-perl-0.37/t/054_parameterized_backref.t --- libbread-board-perl-0.32/t/054_parameterized_backref.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/t/054_parameterized_backref.t 2019-06-28 23:19:54.000000000 +0000 @@ -29,11 +29,11 @@ }; }; -is $c->fetch('Bar')->create(Baz => $c->fetch('Bif'))->resolve(service => 'moo'), 165; +is $c->fetch('Bar')->create(Baz => $c->fetch('Bif'))->resolve(service => 'moo'), 165, 'container works as expected'; my $clone; -is exception { $clone = $c->clone }, undef; +is exception { $clone = $c->clone }, undef, 'cloning the container does not throw an exception'; -is $clone->fetch('Bar')->create(Baz => $clone->fetch('Bif'))->resolve(service => 'moo'), 165; +is $clone->fetch('Bar')->create(Baz => $clone->fetch('Bif'))->resolve(service => 'moo'), 165, 'can do parameterized backref from clone'; done_testing; diff -Nru libbread-board-perl-0.32/t/152_sugar_service_inheritance.t libbread-board-perl-0.37/t/152_sugar_service_inheritance.t --- libbread-board-perl-0.32/t/152_sugar_service_inheritance.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/t/152_sugar_service_inheritance.t 2019-06-28 23:19:54.000000000 +0000 @@ -56,8 +56,8 @@ ); isa_ok $t, 'Thing'; - is $t->foo, 42; - is $t->moo, 123; + is $t->foo, 42, '... and has a foo literal'; + is $t->moo, 123, '... and has a moo literal'; } container $c => as { @@ -80,10 +80,10 @@ ); isa_ok $t, 'TestThing'; - is $t->foo, 42; - is $t->moo, 123; - is $t->bar, 23; - is $t->kooh, 456; + is $t->foo, 42, '... and has a foo literal'; + is $t->moo, 123, '... and has moo literal'; + is $t->bar, 23, '... and has a bar literal'; + is $t->kooh, 456, '... and has a kooh literal'; } } @@ -98,26 +98,26 @@ my $c = $parameterized->create(Config => container Config => as {}); - is $c->resolve(service => 'foo'), 23; + is $c->resolve(service => 'foo'), 23, 'Can resolve foo from parameterized container'; } like exception { service '+foo' => 42; -}, qr/^Service inheritance doesn't make sense for literal services/; +}, qr/^Service inheritance doesn't make sense for literal services/, 'exception thrown when trying to do service inheritance from literal service'; like exception { container Foo => as { container foo => as {}; service '+foo' => (block => sub { 42 }); }; -}, qr/^Trying to inherit from service 'foo', but found a Bread::Board::Container/; +}, qr/^Trying to inherit from service 'foo', but found a Bread::Board::Container/, 'exception thrown when trying to inherit from a container'; like exception { container Foo => as { service foo => 42; service '+foo' => (block => sub { 123 }); }; -}, qr/^Trying to inherit from a literal service/; +}, qr/^Trying to inherit from a literal service/, 'exception thrown when trying to inherit from literal service'; { package Bread::Board::FooInjection; @@ -131,14 +131,14 @@ service foo => (block => sub { 123 }); service '+foo' => (service_class => 'Bread::Board::FooInjection'); }; -}, qr/^Changing a service's class is not possible when inheriting/; +}, qr/^Changing a service's class is not possible when inheriting/, 'exception thrown when trying to change a service class when inheriting'; like exception { container Foo => as { service foo => (block => sub { 123 }); service '+foo' => (service_type => 'Foo'); }; -}, qr/^Changing a service's class is not possible when inheriting/; +}, qr/^Changing a service's class is not possible when inheriting/, 'exception thrown when trying to change a service type when inheriting'; { package Foo; @@ -151,13 +151,13 @@ service foo => (block => sub { 123 }); service '+foo' => (class => 'Foo'); }; -}, qr/^/; +}, qr/^/, 'exception thrown when trying to change a service class for "+foo"'; like exception { container Foo => as { service foo => (class => 'Foo'); service '+foo' => (block => sub { 123 }); }; -}, qr/^/; +}, qr/^/, 'exception thrown when trying to change a service class for "foo"'; done_testing; diff -Nru libbread-board-perl-0.32/t/153_sugar_container_inheritance.t libbread-board-perl-0.37/t/153_sugar_container_inheritance.t --- libbread-board-perl-0.32/t/153_sugar_container_inheritance.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/t/153_sugar_container_inheritance.t 2019-06-28 23:19:54.000000000 +0000 @@ -46,28 +46,28 @@ }; }; - is $c->resolve(service => 'Bar/baz'), 21; - is $c->resolve(service => 'Bar/bif'), 123; + is $c->resolve(service => 'Bar/baz'), 21, 'can resolve Bar/Baz from container'; + is $c->resolve(service => 'Bar/bif'), 123, 'can resolve Bar/bif from container'; my $p = $c->fetch('Moo')->create(Bar => $c->fetch('Bar')); - is $p->resolve(service => 'kooh'), 42; - is $p->resolve(service => 'boo'), 165; + is $p->resolve(service => 'kooh'), 42, 'can resolve kooh from parameterized container'; + is $p->resolve(service => 'boo'), 165, 'can resolve boo from parameterized container'; like exception { container '+Foo' => as {}; - }, qr/^Inheriting containers isn't possible outside of the context of a container/; + }, qr/^Inheriting containers isn't possible outside of the context of a container/, 'exception thrown when trying to inherit +Foo outside of container context'; like exception { container $c => as { container '+Buf' => as {}; }; - }, qr/^Could not find container or service for Buf in Foo/; + }, qr/^Could not find container or service for Buf in Foo/, 'exception thrown when trying to inherit +Buf and it does not exist'; like exception { container $c => as { container '+Buf' => ['Moo'] => as {}; }; - }, qr/^Declaring container parameters when inheriting is not supported/; + }, qr/^Declaring container parameters when inheriting is not supported/, 'exception thrown when trying to declare container parameters when inheriting'; } { @@ -100,8 +100,8 @@ }; }; - isa_ok $c->resolve(service => 'Moo/Kooh/boo'), 'Thing'; - is $c->resolve(service => 'Moo/Kooh/boo')->bar, 42; + isa_ok $c->resolve(service => 'Moo/Kooh/boo'), 'Thing', 'can resolve Moo/Kooh/boo and get Thing'; + is $c->resolve(service => 'Moo/Kooh/boo')->bar, 42, '... and can call bar method on it'; container $c => as { container '+Moo/Kooh' => as { @@ -109,8 +109,8 @@ }; }; - isa_ok $c->resolve(service => 'Moo/Kooh/boo'), 'TestThing'; - is $c->resolve(service => 'Moo/Kooh/boo')->bar, 42; + isa_ok $c->resolve(service => 'Moo/Kooh/boo'), 'TestThing', 'can resolve Moo/Kooh/boo and get TestThing'; + is $c->resolve(service => 'Moo/Kooh/boo')->bar, 42, '... and can call bar method on it'; } done_testing; diff -Nru libbread-board-perl-0.32/t/300_no_new.t libbread-board-perl-0.37/t/300_no_new.t --- libbread-board-perl-0.32/t/300_no_new.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/t/300_no_new.t 2019-06-28 23:19:54.000000000 +0000 @@ -4,7 +4,7 @@ use Bread::Board (); -ok !Bread::Board->can("new"); +ok !Bread::Board->can("new"), 'Bread::Board has no new() method'; done_testing; diff -Nru libbread-board-perl-0.32/t/302_path_traversal_deprecation.t libbread-board-perl-0.37/t/302_path_traversal_deprecation.t --- libbread-board-perl-0.32/t/302_path_traversal_deprecation.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/t/302_path_traversal_deprecation.t 2019-06-28 23:19:54.000000000 +0000 @@ -14,8 +14,8 @@ local $SIG{__WARN__} = sub { $warning = $_[0] }; my $baz = $c->resolve(service => '/Foo/bar'); - is($baz, 'baz'); - like($warning, qr/Traversing into the current container \(Foo\) is deprecated; you should remove the Foo component from the path/); + is($baz, 'baz', 'resolving service path in deprecated way still works'); + like($warning, qr/Traversing into the current container \(Foo\) is deprecated; you should remove the Foo component from the path/, '... but gives a nice warning'); } done_testing; diff -Nru libbread-board-perl-0.32/t/310_literal_keyword.t libbread-board-perl-0.37/t/310_literal_keyword.t --- libbread-board-perl-0.32/t/310_literal_keyword.t 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/t/310_literal_keyword.t 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,21 @@ +use strict; +use warnings; + +use Test::More tests => 1; + +use Bread::Board; + +my $c = container 'Main' => as { + service with_literal => ( + block => sub { $_[0]->param('foo') . join '', @{ $_[0]->param('bar') } }, + dependencies => { + foo => literal( 'fantastic' ), + bar => literal( [ 1..5 ] ), + }, + ); +}; + +is $c->resolve( service => 'with_literal' ) => 'fantastic12345', 'got expected service string from literals'; + + + diff -Nru libbread-board-perl-0.32/t/500-gh61.t libbread-board-perl-0.37/t/500-gh61.t --- libbread-board-perl-0.32/t/500-gh61.t 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/t/500-gh61.t 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,74 @@ +use Test::Requires 'Moo'; + +{ + package Foo; + + use Moo; + + has str => ( is => 'rw', default => '' ); + + sub BUILD { + my ($self, $args) = @_; + + $self->str($self->str); + } + + around str => sub { + my ($orig, $self, $val) = @_; + + return $orig->($self) unless defined $val; + + $orig->( $self, 'prefix_'.$val); + }; +} + + +# BB was using Class::MOP::class_of to determine +# the constructor, and that plays havoc with Moo, +# it seems +{ package Bar; use Moo; extends 'Foo'; } + +{ package Baz; use Moose; extends 'Foo'; } + +package main; + +use strict; +use warnings; + +use Test::More; + +use Bread::Board; + +my $c = container 'MyApp' => as { + map { + service lc $_ => ( + class => $_, + parameters => { str => { optional => 1 } } + ) + } qw/ Foo Bar Baz / +}; + + +subtest $_, \&test_class, $_ for qw/ Foo Bar Baz/; + +done_testing; + +sub test_class { + my $class = shift; + my $plain = $class->new({ str => 'foo_plain' }); + is $plain->str => 'prefix_foo_plain'; + + my $bb = $c->resolve( service => lc $class, parameters => { str => 'foo_bb' } ); + is( $class->new( str => 'foo_plain' )->str => 'prefix_foo_plain', 'plain after resolve' ); + + is $bb->str => 'prefix_foo_bb'; + is $plain->str => 'prefix_foo_plain', 'plain after str'; + + $bb->str('foo_bb_setter'); + is $bb->str => 'prefix_foo_bb_setter'; + + my $plain_after_bb = $class->new({ str => 'foo_plain_after_bb' }); + is $plain_after_bb->str => 'prefix_foo_plain_after_bb'; + + is( Foo->new( str => 'foo_plain' )->str => 'prefix_foo_plain', 'Foo untouched' ); +} diff -Nru libbread-board-perl-0.32/xt/release/eol.t libbread-board-perl-0.37/xt/release/eol.t --- libbread-board-perl-0.32/xt/release/eol.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/xt/release/eol.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -use strict; -use warnings; -use Test::More; - -eval 'use Test::EOL'; -plan skip_all => 'Test::EOL required' if $@; - -all_perl_files_ok({ trailing_whitespace => 1 }); diff -Nru libbread-board-perl-0.32/xt/release/no-tabs.t libbread-board-perl-0.37/xt/release/no-tabs.t --- libbread-board-perl-0.32/xt/release/no-tabs.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/xt/release/no-tabs.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -use strict; -use warnings; - -# this test was generated with Dist::Zilla::Plugin::NoTabsTests 0.07 - -use Test::More 0.88; -use Test::NoTabs; - -my @files = ( - 'lib/Bread/Board.pm', - 'lib/Bread/Board/BlockInjection.pm', - 'lib/Bread/Board/ConstructorInjection.pm', - 'lib/Bread/Board/Container.pm', - 'lib/Bread/Board/Container/FromParameterized.pm', - 'lib/Bread/Board/Container/Parameterized.pm', - 'lib/Bread/Board/Dependency.pm', - 'lib/Bread/Board/Dumper.pm', - 'lib/Bread/Board/LifeCycle.pm', - 'lib/Bread/Board/LifeCycle/Singleton.pm', - 'lib/Bread/Board/LifeCycle/Singleton/WithParameters.pm', - 'lib/Bread/Board/Literal.pm', - 'lib/Bread/Board/Manual.pod', - 'lib/Bread/Board/Manual/Concepts.pod', - 'lib/Bread/Board/Manual/Concepts/Advanced.pod', - 'lib/Bread/Board/Manual/Concepts/Typemap.pod', - 'lib/Bread/Board/Manual/Example.pod', - 'lib/Bread/Board/Manual/Example/FormSensible.pod', - 'lib/Bread/Board/Manual/Example/LogDispatch.pod', - 'lib/Bread/Board/Service.pm', - 'lib/Bread/Board/Service/Alias.pm', - 'lib/Bread/Board/Service/Deferred.pm', - 'lib/Bread/Board/Service/Deferred/Thunk.pm', - 'lib/Bread/Board/Service/Inferred.pm', - 'lib/Bread/Board/Service/WithClass.pm', - 'lib/Bread/Board/Service/WithDependencies.pm', - 'lib/Bread/Board/Service/WithParameters.pm', - 'lib/Bread/Board/SetterInjection.pm', - 'lib/Bread/Board/Traversable.pm', - 'lib/Bread/Board/Types.pm', - 't/00-compile.t', - 't/001_constructor_injection.t', - 't/002_setter_injection.t', - 't/003_block_injection.t', - 't/004_block_injection_w_out_class.t', - 't/005_alias.t', - 't/010_container.t', - 't/011_container_path.t', - 't/012_container_with_shared_deps.t', - 't/020_sugar.t', - 't/021_sugar.t', - 't/022_sugar.t', - 't/023_sugar.t', - 't/024_sugar.t', - 't/025_sugar_w_absolute_path.t', - 't/026_sugar_remove.t', - 't/027_sugar_w_include.t', - 't/028_sugar_w_recursive_inc.t', - 't/029_sugar_auto_wire_names.t', - 't/030_lifecycle_singleton.t', - 't/031_custom_lifecycles.t', - 't/032_singleton_cycle.t', - 't/040_circular_dependencies.t', - 't/041_parameter_cache_handling.t', - 't/042_parameter_cache_with_singleton.t', - 't/043_parameter_leaks.t', - 't/044_deferred_parameters.t', - 't/045_parameters_in_dependency.t', - 't/046_custom_parameter_service.t', - 't/047_dependencies_override_parameters.t', - 't/048_array_deps.t', - 't/050_parameterized_containers.t', - 't/051_more_parameterized_containers.t', - 't/052_parameterized_in_hierarchy.t', - 't/053_parameterized_clone.t', - 't/054_parameterized_backref.t', - 't/060_extend_w_sugar.t', - 't/061_extends_w_sugar_and_inheritance.t', - 't/062_service_class_w_sugar.t', - 't/070_with_basic_typemap.t', - 't/071_typemap_with_basic_infer.t', - 't/072_typemap_with_more_infer.t', - 't/073_typemap_with_role_infer.t', - 't/074_typemap_w_recursive_infer.t', - 't/075_complex_typemap_example.t', - 't/076_more_complex_typemap.t', - 't/077_more_complex_typemap_w_roles.t', - 't/078_complex_typemap_w_error.t', - 't/079_depending_on_type.t', - 't/080_infer_subclasses.t', - 't/100_clone_w_constructor_injection.t', - 't/101_clone_w_setter_injection.t', - 't/102_clone_w_block_injection.t', - 't/110_clone_w_singleton.t', - 't/150_deferred_parameters_fail.t', - 't/151_sugar_no_container.t', - 't/152_sugar_service_inheritance.t', - 't/153_sugar_container_inheritance.t', - 't/200_example_code.t', - 't/201_log_dispatch_example.t', - 't/202_form_sensible_example.t', - 't/300_no_new.t', - 't/301_sugar.t', - 't/302_path_traversal_deprecation.t', - 't/lib/bad.bb', - 't/lib/false.bb', - 't/lib/logger.bb', - 't/lib/my_app.bb' -); - -notabs_ok($_) foreach @files; -done_testing; diff -Nru libbread-board-perl-0.32/xt/release/pod-coverage.t libbread-board-perl-0.37/xt/release/pod-coverage.t --- libbread-board-perl-0.32/xt/release/pod-coverage.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/xt/release/pod-coverage.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#!perl -# This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. - -use Test::Pod::Coverage 1.08; -use Pod::Coverage::TrustPod; - -all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); diff -Nru libbread-board-perl-0.32/xt/release/pod-syntax.t libbread-board-perl-0.37/xt/release/pod-syntax.t --- libbread-board-perl-0.32/xt/release/pod-syntax.t 2014-06-03 15:36:49.000000000 +0000 +++ libbread-board-perl-0.37/xt/release/pod-syntax.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!perl -# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. -use Test::More; -use Test::Pod 1.41; - -all_pod_files_ok(); diff -Nru libbread-board-perl-0.32/xt/release/unused-vars.t libbread-board-perl-0.37/xt/release/unused-vars.t --- libbread-board-perl-0.32/xt/release/unused-vars.t 1970-01-01 00:00:00.000000000 +0000 +++ libbread-board-perl-0.37/xt/release/unused-vars.t 2019-06-28 23:19:54.000000000 +0000 @@ -0,0 +1,14 @@ +#!perl + +use Test::More 0.96 tests => 1; +eval { require Test::Vars }; + +SKIP: { + skip 1 => 'Test::Vars required for testing for unused vars' + if $@; + Test::Vars->import; + + subtest 'unused vars' => sub { +all_vars_ok(); + }; +};