| 1 |
Source: libex-monkeypatched-perl |
| 2 |
Section: perl |
| 3 |
Priority: optional |
| 4 |
Build-Depends: |
| 5 |
debhelper-compat (= 13), |
| 6 |
libsub-name-perl, |
| 7 |
libtest-exception-perl |
| 8 |
Maintainer: Debian Perl Group <[email protected]> |
| 9 |
Uploaders: Jonas Smedegaard <[email protected]> |
| 10 |
Standards-Version: 4.7.2 |
| 11 |
Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libex-monkeypatched-perl.git |
| 12 |
Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libex-monkeypatched-perl |
| 13 |
Homepage: https://metacpan.org/release/ex-monkeypatched |
| 14 |
Testsuite: autopkgtest-pkg-perl |
| 15 |
|
| 16 |
Package: libex-monkeypatched-perl |
| 17 |
Architecture: all |
| 18 |
Depends: |
| 19 |
libsub-name-perl, |
| 20 |
${perl:Depends}, |
| 21 |
${misc:Depends}, |
| 22 |
Description: experimental API for safe monkey-patching |
| 23 |
The term "monkey patching" describes injecting additional methods into |
| 24 |
a class whose implementation you don't control. If done without care, |
| 25 |
this is dangerous; the problematic case arises when: |
| 26 |
* You add a method to a class; |
| 27 |
* A newer version of the monkey-patched class adds another method of |
| 28 |
the same name |
| 29 |
* And uses that new method in some other part of its own |
| 30 |
implementation. |
| 31 |
. |
| 32 |
ex::monkeypatched lets you do this sort of monkey-patching safely: |
| 33 |
before it injects a method into the target class, it checks whether the |
| 34 |
class already has a method of the same name. If it finds such a |
| 35 |
method, it throws an exception (at compile-time with respect to the |
| 36 |
code that does the injection). |
| 37 |
. |
| 38 |
See <http://aaroncrane.co.uk/talks/monkey_patching_subclassing/> for |
| 39 |
more details. |