Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Tomcat42
perl-Plack-Middleware-Debug
perl-Plack-Middleware-Debug.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File perl-Plack-Middleware-Debug.spec of Package perl-Plack-Middleware-Debug
# # spec file for package perl-Plack-Middleware-Debug # # Copyright (c) 2020 SUSE LLC # # 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 https://bugs.opensuse.org/ # Name: perl-Plack-Middleware-Debug Version: 0.18 Release: 0 %define cpan_name Plack-Middleware-Debug Summary: Display information about the current request/response License: Artistic-1.0 OR GPL-1.0-or-later Group: Development/Libraries/Perl URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Class::Method::Modifiers) >= 1.05 BuildRequires: perl(Data::Dump) BuildRequires: perl(Data::Dumper::Concise) BuildRequires: perl(Encode) >= 2.23 BuildRequires: perl(File::ShareDir) >= 1.00 BuildRequires: perl(Module::Build::Tiny) >= 0.034 BuildRequires: perl(Plack) BuildRequires: perl(Plack::Test) BuildRequires: perl(Test::More) >= 0.70 BuildRequires: perl(Test::Requires) >= 0.08 BuildRequires: perl(Text::MicroTemplate) >= 0.15 BuildRequires: perl(parent) Requires: perl(Class::Method::Modifiers) >= 1.05 Requires: perl(Data::Dump) Requires: perl(Data::Dumper::Concise) Requires: perl(Encode) >= 2.23 Requires: perl(File::ShareDir) >= 1.00 Requires: perl(Plack) Requires: perl(Text::MicroTemplate) >= 0.15 Requires: perl(parent) %{perl_requires} %description The debug middleware offers a configurable set of panels that displays information about the current request and response. The information is generated only for responses with a status of 200 ('OK') and a 'Content-Type' that contains 'text/html' or 'application/xhtml+xml' and is embedded in the HTML that is sent back to the browser. Note that the code is injected *directly before the closing tag* ('</body>') so if there is no such tag, the debug panel will not be injected at all. To enable the middleware, just use Plack::Builder as usual in your '.psgi' file: use Plack::Builder; builder { enable 'Debug', panels => [ qw(DBITrace Memory Timer) ]; $app; }; The 'Debug' middleware takes an optional 'panels' argument whose value is expected to be a reference to an array of panel specifications. If given, only those panels will be enabled. If you don't pass a 'panels' argument, the default list of panels - 'Environment', 'Response', 'Timer', 'Memory', 'Session' and 'DBITrace' - will be enabled, each with their default settings, and automatically disabled if their target modules or middleware components are not loaded. Each panel specification can take one of three forms: * A string This is interpreted as the base name of a panel in the 'Plack::Middeware::Debug::' namespace, unless preceded by '+', in which case it's interpreted as an absolute name similar to how Plack::Builder handles such names, e.g. '+My::Plack::Middleware::Debug::Something'. The panel class is loaded and a panel object is created with its default settings. * An array reference If you need to pass arguments to the panel object as it is created, you may use this form (But see below). The first element of the array reference has to be the panel base name. The remaining elements are key/value pairs to be passed to the panel. For example: builder { enable 'Debug', panels => [ qw(Environment Response Timer Memory), [ 'DBITrace', level => 2 ] ]; $app; }; Because each panel is a middleware component, you can write this way as well: builder { enable 'Debug'; # load defaults enable 'Debug::DBITrace', level => 2; $app; }; Note that the '<enable 'Debug''> line should come before other Debug panels because of the order middleware components are executed. * Custom middleware You can also pass a Panel middleware component. This might be useful if you have custom debug panels in your framework or web application. %prep %setup -q -n %{cpan_name}-%{version} find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644 %build perl Build.PL --installdirs=vendor ./Build build --flags=%{?_smp_mflags} %check ./Build test %install ./Build install --destdir=%{buildroot} --create_packlist=0 %perl_gen_filelist %files -f %{name}.files %defattr(-,root,root,755) %doc Changes examples README %license LICENSE %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