From 8714ea665285040c3ffbb8dbea01781feae30d81 Mon Sep 17 00:00:00 2001 From: Arne Becker <101113822+EbiArnie@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:56:08 +0000 Subject: [PATCH] perl-catalyst-component-instancepercontext: new package (#42962) Adds Catalyst::Component::InstancePerContext --- .../package.py | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 var/spack/repos/builtin/packages/perl-catalyst-component-instancepercontext/package.py diff --git a/var/spack/repos/builtin/packages/perl-catalyst-component-instancepercontext/package.py b/var/spack/repos/builtin/packages/perl-catalyst-component-instancepercontext/package.py new file mode 100644 index 0000000000..e35e823cbb --- /dev/null +++ b/var/spack/repos/builtin/packages/perl-catalyst-component-instancepercontext/package.py @@ -0,0 +1,30 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PerlCatalystComponentInstancepercontext(PerlPackage): + """Moose role to create only one instance of component per context""" + + homepage = "https://metacpan.org/pod/Catalyst::Component::InstancePerContext" + url = "https://cpan.metacpan.org/authors/id/G/GR/GRODITI/Catalyst-Component-InstancePerContext-0.001001.tar.gz" + + maintainers("EbiArnie") + + license("Artistic-1.0-Perl OR GPL-1.0-or-later") + + version("0.001001", sha256="7f63f930e1e613f15955c9e6d73873675c50c0a3bc2a61a034733361ed26d271") + + depends_on("perl-catalyst-runtime", type=("build", "run", "test")) + depends_on("perl-moose", type=("build", "run", "test")) + + def test_use(self): + """Test 'use module'""" + options = ["-we", 'use strict; use Catalyst::Component::InstancePerContext; print("OK\n")'] + + perl = self.spec["perl"].command + out = perl(*options, output=str.split, error=str.split) + assert "OK" in out