Make Net::OpenSSH::More loadable - #56
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to make lib/Net/OpenSSH/More.pm loadable as a standalone Perl module (instead of behaving like an include fragment) so that it can be checked/loaded independently and packaged correctly (per Issue #37).
Changes:
- Adds a module header to
More.pm(package declaration,strict/warnings, loadNet::OpenSSH, declare$debug, and return true). - Adds
lib/Net/OpenSSH/More.pmtoMANIFESTso it is included in the packaged distribution.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| MANIFEST | Ensures More.pm is shipped as part of the distribution. |
| lib/Net/OpenSSH/More.pm | Attempts to make More.pm independently loadable by adding a proper module preamble and 1;. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| package Net::OpenSSH; | ||
|
|
||
| use strict; | ||
| use warnings; | ||
|
|
||
| use Net::OpenSSH (); | ||
|
|
||
| our $debug; | ||
|
|
There was a problem hiding this comment.
I checked this locally and the import concern does not reproduce. Both of these succeed on this branch:\n\nperl -Ilib -MNet::OpenSSH::More -e 'print Net::OpenSSH->can(q(scp_cat)) ? qq(ok\n) : qq(missing\n)'\n\nperl -Ilib -e 'use Net::OpenSSH::More; print Net::OpenSSH->can(q(scp_cat)) ? qq(ok\n) : qq(missing\n)'\n\nI added t/more.t anyway to make that load behavior explicit and keep it covered.
| package Net::OpenSSH; | ||
|
|
||
| use strict; | ||
| use warnings; | ||
|
|
||
| use Net::OpenSSH (); |
There was a problem hiding this comment.
Fixed in commit 3c58f1a by adding t/more.t, which runs use Net::OpenSSH::More and verifies Net::OpenSSH->can('scp_cat').
Summary
Make
lib/Net/OpenSSH/More.pma valid standalone module instead of an installed source fragment.Changes
package Net::OpenSSH.strictandwarnings.Net::OpenSSHso internal helpers/constants are available.$debugused by the extension.More.pmtoMANIFEST.Fixes #37.
Testing
perl -Ilib -c lib/Net/OpenSSH/More.pmperl -Ilib -MNet::OpenSSH::More -e 'print Net::OpenSSH->can(q(scp_cat)) ? qq(ok\\n) : qq(missing\\n)'perl -Ilib -c lib/Net/OpenSSH.pm