App::GHPT::WorkSubmitter::Role::Question - Role for writing interactive questions about the commits
version 1.000011
package App::GHPT::WorkSubitter::Question::WarnAboutPasswordFile; use App::GHPT::Wrapper::OurMoose; with 'App::GHPT::WorkSubmitter::Role::Question'; sub ask($self) { # skip the question unless there's a password file return unless $self->changed_files->changed_files_match(qr/password/); # ask the user if that's okay return $self->ask_question(<<'ENDOFTEXT',"I'm okay with the risk"); You've committed a file with a name matching 'password'. Are you nuts? ENDOFTEXT } __PACKAGE__->meta->make_immutable; 1;
This role allows you to write questions to ask someone when creating pull request.
You want to create these questions classes in the App::GHPT::WorkSubmitter::Question::* namespace where App::GHPT::WorkSubmitter::Questioner will automatically detect them and ask them each time gh-pt.pl is run.
App::GHPT::WorkSubmitter::Question::*
gh-pt.pl
Each class must supply an ask method which should prompt the user as needed and return any markdown to be placed in the pull request body.
ask
The files that have changed in this branch. This is the primary attribute you want to examine.
Interactively ask a question and return markdown suitable for including in the pull request body.
The question that should be asked must be passed as the first argument, and all other arguments are treated as stock answers the user can select when asked the question. The user will also have a final option Launch Editor which will launch their editor and allow them free-form text input.
Launch Editor
Bugs may be submitted through https://github.com/maxmind/App-GHPT/issues.
Mark Fowler <mark@twoshortplanks.com>
Dave Rolsky <autarch@urth.org>
This software is Copyright (c) 2019 by MaxMind, Inc.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install App::GHPT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::GHPT
CPAN shell
perl -MCPAN -e shell install App::GHPT
For more information on module installation, please visit the detailed CPAN module installation guide.