| 1 | package Test::Smoke::App::ConfigSmoke::SmokeDB; | ||
| 2 | use warnings; | ||
| 3 | use strict; | ||
| 4 | |||
| 5 | our $VERSION = '0.001'; | ||
| 6 | |||
| 7 | use Exporter 'import'; | ||
| 8 | our @EXPORT = qw/ config_smoke_db /; | ||
| 9 | |||
| 10 | use Test::Smoke::App::AppOption; | ||
| 11 | use Test::Smoke::App::Options; | ||
| 12 | |||
| 13 | =head1 NAME | ||
| 14 | |||
| 15 | Test::Smoke::App::ConfigSmoke::SmokeDB - Mixin for Test::Smoke::App::ConfigSmoke. | ||
| 16 | |||
| 17 | =head1 DESCRIPTION | ||
| 18 | |||
| 19 | These methods will be added to the L<Test::Smoke::App::ConfigSmoke> class. | ||
| 20 | |||
| 21 | =head2 config_smoke_db | ||
| 22 | |||
| 23 | Configure options: C<smokedb_url>, C<send_log>, C<send_out>, C<ua_timeout> and C<poster_type> | ||
| 24 | |||
| 25 | =cut | ||
| 26 | |||
| 27 | sub config_smoke_db { | ||
| 28 | my $self = shift; | ||
| 29 | |||
| 30 | print "\n-- CoreSmokeDB section --\n"; | ||
| 31 | |||
| 32 | my $url = $self->handle_option(Test::Smoke::App::Options->smokedb_url); | ||
| 33 | if (! $url ) { | ||
| 34 | $self->current_values->{poster} = ''; | ||
| 35 | return; | ||
| 36 | } | ||
| 37 | |||
| 38 | my $poster = Test::Smoke::App::Options->poster_config(); | ||
| 39 | my $post_type = $self->handle_option(Test::Smoke::App::Options->poster); | ||
| 40 | |||
| 41 | my @poster_options = sort { | ||
| 42 | $a->configord <=> $b->configord | ||
| 43 | } @{ $poster->{$post_type} }; | ||
| 44 | for my $option (@poster_options) { | ||
| 45 | $self->handle_option($option); | ||
| 46 | } | ||
| 47 | |||
| 48 | for my $send_stuff (qw/send_log send_out/) { | ||
| 49 | $self->handle_option(Test::Smoke::App::Options->$send_stuff); | ||
| 50 | } | ||
| 51 | |||
| 52 | $self->current_values->{mail} = 0; | ||
| 53 | } | ||
| 54 | |||
| 55 | 1; | ||
| 56 | |||
| 57 | =head1 COPYRIGHT | ||
| 58 | |||
| 59 | E<copy> MMXX - All rights reserved. | ||
| 60 | |||
| 61 | * Abe Timmerman <abeltje@cpan.org> | ||
| 62 | |||
| 63 | This library is free software; you can redistribute it and/or modify | ||
| 64 | it under the same terms as Perl itself. | ||
| 65 | |||
| 66 | See: | ||
| 67 | |||
| 68 | =over 4 | ||
| 69 | |||
| 70 | =item * L<http://www.perl.com/perl/misc/Artistic.html> | ||
| 71 | |||
| 72 | =item * L<http://www.gnu.org/copyleft/gpl.html> | ||
| 73 | |||
| 74 | =back | ||
| 75 | |||
| 76 | This program is distributed in the hope that it will be useful, | ||
| 77 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 78 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| 79 | |||
| 80 | =cut |