| 1 | package Test::Smoke::App::ConfigSmoke::Reporter; | ||
| 2 | use warnings; | ||
| 3 | use strict; | ||
| 4 | |||
| 5 | our $VERSION = '0.001'; | ||
| 6 | |||
| 7 | use Exporter 'import'; | ||
| 8 | our @EXPORT = qw/ config_reporter_options /; | ||
| 9 | |||
| 10 | use Test::Smoke::App::Options; | ||
| 11 | |||
| 12 | =head1 NAME | ||
| 13 | |||
| 14 | Test::Smoke::App::ConfigSmoke::Reporter - Mixin for L<Test::Smoke::App::ConfigSmoke> | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | These methods will be added to the L<Test::Smoke::App::ConfigSmoke> class. | ||
| 19 | |||
| 20 | =head2 config_make_options | ||
| 21 | |||
| 22 | Configure options C<hostname>, C<usernote> and C<usernote_pos> | ||
| 23 | |||
| 24 | =cut | ||
| 25 | |||
| 26 | sub config_reporter_options { | ||
| 27 | my $self = shift; | ||
| 28 | |||
| 29 | print "\n-- Reporter section --\n"; | ||
| 30 | |||
| 31 | $self->handle_option(Test::Smoke::App::Options->hostname); | ||
| 32 | |||
| 33 | my $un_file = $self->handle_option(Test::Smoke::App::Options->un_file); | ||
| 34 | |||
| 35 | if ($un_file) { | ||
| 36 | if (! -f $un_file) { | ||
| 37 | open(my $fh, '>', $un_file); | ||
| 38 | close($fh); | ||
| 39 | print " >> Created $un_file.\n"; | ||
| 40 | } | ||
| 41 | $self->handle_option(Test::Smoke::App::Options->un_position); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | |||
| 45 | 1; | ||
| 46 | |||
| 47 | =head1 COPYRIGHT | ||
| 48 | |||
| 49 | (c) 2020, All rights reserved. | ||
| 50 | |||
| 51 | * Abe Timmerman <abeltje@cpan.org> | ||
| 52 | |||
| 53 | This library is free software; you can redistribute it and/or modify | ||
| 54 | it under the same terms as Perl itself. | ||
| 55 | |||
| 56 | See: | ||
| 57 | |||
| 58 | =over 4 | ||
| 59 | |||
| 60 | =item * L<http://www.perl.com/perl/misc/Artistic.html> | ||
| 61 | |||
| 62 | =item * L<http://www.gnu.org/copyleft/gpl.html> | ||
| 63 | |||
| 64 | =back | ||
| 65 | |||
| 66 | This program is distributed in the hope that it will be useful, | ||
| 67 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 68 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| 69 | |||
| 70 | =cut |