Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:languages:perl:CPAN-C
perl-Catalyst-Plugin-MapComponentDependencies
perl-Catalyst-Plugin-MapComponentDependencies.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File perl-Catalyst-Plugin-MapComponentDependencies.spec of Package perl-Catalyst-Plugin-MapComponentDependencies
# # spec file for package perl-Catalyst-Plugin-MapComponentDependencies # # Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: perl-Catalyst-Plugin-MapComponentDependencies Version: 0.009 Release: 0 %define cpan_name Catalyst-Plugin-MapComponentDependencies Summary: Allow components to depend on other components License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Catalyst-Plugin-MapComponentDependencies/ Source0: http://www.cpan.org/authors/id/J/JJ/JJNAPIORK/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Catalyst) >= 5.90090 BuildRequires: perl(Catalyst::Test) BuildRequires: perl(Moose) >= 2.0602 BuildRequires: perl(Test::Most) Requires: perl(Catalyst) >= 5.90090 Requires: perl(Moose) >= 2.0602 %{perl_requires} %description Sometimes you would like a Catalyst component to depend on the value of an existing component. Since components are resolved during application setup (or at request time, in the cause of a component that does ACCEPT_CONTEXT) you cannot specify this dependency mapping in the 'normal' Catalyst configuration hash. This plugin, which requires a recent Catalyst of version 5.90090+, allows you to define components which depend on each other. You can also set the value of an initial argument to the value of a coderef, for added dynamic flexibility. You may define dependencies in one of two ways. The first way is to use a key/value pair to map a configuation key attribute to the value of an existing Catalyst model. When the depending model is called, we get the value of that model in the same way as if we called '$c->model($name)'. You can by the way use any type of Catalys component as a value (models, views and even controllers). The second way is to use a coderef, which is expected to return a value suitable for the depending model. This gives you a little more flexibility for crafting very custom types of dependencies. If you use a coderef you will get three values, the application (or context depending on if the depending model does ACCEPT_CONTEXT), the component name and a reference to any static configuration for the model (from the global configuration, for example). *NOTE*: Currently we only map dependencies 'one level' into the configuration hash. Which means the following works as expected: MyApp->map_dependencies( 'Model::Foo' => { baz => sub { my ($app_or_ctx, $component_name, $config) = @_; return ...; }, }, ); But not this: MyApp->map_dependencies( 'Model::Foo' => { baz => { bar => sub { my ($app_or_ctx, $component_name, $config) = @_; return ...; }, }, }, ); I'm not sure if I consider this limitation a feature or not... If you have good use cases let me know and I'll consider a fix. %prep %setup -q -n %{cpan_name}-%{version} %build %{__perl} Makefile.PL INSTALLDIRS=vendor %{__make} %{?_smp_mflags} %check %{__make} test %install %perl_make_install %perl_process_packlist %perl_gen_filelist %files -f %{name}.files %defattr(-,root,root,755) %doc Changes LICENSE README README.mkdn %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor