Test::S...::Policy(3)

πŸ“¦
version 1.84 Β· 2 versions
, in fedora 43

πŸ’– Test::S...::Policy(3) πŸ’–

okay so bestie, welcome to the User Contributed Perl Documentation section, this is Test::S...::Policy and she's here to serve πŸ’…


✨ NAME ✨

Test::Smoke::Policy β€” an OO interface to handle the Policy.sh stuff. no cap, that's the whole job πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

use Test::Smoke::Policy;

my $srcpath = File::Spec->updir;
my $policy = Test::Smoke::Policy->new( $srcpath );

$policy->substitute( [] );
$policy->write;

look at her go, iconic behavior honestly 🌸


🌈 DESCRIPTION 🌈

fr fr: "I wish I understood what Merijn is doing in the original code."

that's it. that's the description. the author said what they said and honestly? relatable. we've all been there staring at legacy code at 2am πŸ˜­πŸ’€


πŸ‘‘ METHODS πŸ‘‘

πŸ’œ Test::Smoke::Policy->new( $srcpath )

creates a brand new instance of the Policy object, main character energy ✨. it reads the file, or β€” plot twist β€” takes the data straight from the DATA section πŸ“

πŸ’œ $policy->verbose

gets the verbosity. that's it, that's the whole method 🫢

πŸ’œ $policy->set_rules( $rules )

sets the rules for substitutions. setting boundaries, we love to see it πŸ’…

πŸ’œ $policy->reset_rules( )

resets the "_rules" property. clean slate, fresh start, new era 🌸

πŸ’œ $policy->_do_subst( )

_do_subst() does the substitutions and stores the substituted version as the _new_policy attribute. she does the work and she keeps the receipts πŸ”₯

πŸ’œ $policy->write( )

just the signature, bestie β€” the original page doesn't say more about this one, so I'm not gonna make stuff up πŸ™ˆ

πŸ’œ $policy->_read_Policy( $srcpath[, $verbose[, @ccflags]] )

_read_Policy() checks the $srcpath for these conditions:

  • reference to a SCALAR Policy is in $$srcpath ⭐
  • reference to an ARRAY Policy is in @$srcpath ⭐
  • reference to a GLOB Policy is read from the filehandle ⭐
  • other values are taken as the base path for Policy.sh ⭐

the @ccflags get passed to "$self->default_Policy()" πŸŽ€

πŸ’œ $policy->default_Policy( [@ccflags] )

generates the default Policy.sh from a set of ccflags, but β€” and this is the important part β€” be backward compatible. respect the elders, periodt πŸ‘‘


(c) 2001-2015, All rights reserved.

shoutout to the legends who made this happen, no cap:

  • H.Merijn Brand <hmbrand@hccnet.nl>
  • Nicholas Clark <nick@unfortu.net>
  • Abe Timmerman <abeltje@cpan.org>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, open source rights πŸ’–

See:

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. translation: she's hoping for the best, but don't come for her if things go sideways, bestie 😭

and that's the whole page!! this was perl v5.42.0, dated 2025-07-25, and yeah that footer is giving vintage but she still ate πŸ’…βœ¨ bye bestie, go write some Policy.sh πŸ¦‹

πŸ“¦ where this page comes from