| 1 | package Padre::Plugin::ClassSniff; | ||
| 2 | BEGIN { | ||
| 3 | $Padre::Plugin::ClassSniff::VERSION = '0.30'; | ||
| 4 | } | ||
| 5 | |||
| 6 | # ABSTRACT: Simple Class::Sniff interface for Padre | ||
| 7 | |||
| 8 | use 5.008; | ||
| 9 | use warnings; | ||
| 10 | use strict; | ||
| 11 | |||
| 12 | use Padre::Config (); | ||
| 13 | use Padre::Wx (); | ||
| 14 | use Padre::Plugin (); | ||
| 15 | |||
| 16 | our @ISA = 'Padre::Plugin'; | ||
| 17 | |||
| 18 | sub padre_interfaces { | ||
| 19 | 'Padre::Plugin' => 0.47,; | ||
| 20 | } | ||
| 21 | |||
| 22 | sub plugin_name { | ||
| 23 | Wx::gettext('Class Sniffer'); | ||
| 24 | } | ||
| 25 | |||
| 26 | sub menu_plugins_simple { | ||
| 27 | my $self = shift; | ||
| 28 | return $self->plugin_name => [ | ||
| 29 | Wx::gettext('Print Report') => sub { $self->print_report }, | ||
| 30 | Wx::gettext('About') => sub { $self->show_about }, | ||
| 31 | ]; | ||
| 32 | } | ||
| 33 | |||
| 34 | sub print_report { | ||
| 35 | my $self = shift; | ||
| 36 | require Padre::Task::ClassSniff; | ||
| 37 | Padre::Task::ClassSniff->new( | ||
| 38 | mode => 'print_report', | ||
| 39 | )->schedule(); | ||
| 40 | } | ||
| 41 | |||
| 42 | |||
| 43 | |||
| 44 | sub show_about { | ||
| 45 | my $self = shift; | ||
| 46 | |||
| 47 | # Generate the About dialog | ||
| 48 | my $about = Wx::AboutDialogInfo->new; | ||
| 49 | $about->SetName("Padre::Plugin::ClassSniff"); | ||
| 50 | $about->SetDescription( <<"END_MESSAGE" ); | ||
| 51 | Initial Class::Sniff support for Padre | ||
| 52 | END_MESSAGE | ||
| 53 | $about->SetVersion($Padre::Plugin::ClassSniff::VERSION); | ||
| 54 | |||
| 55 | # Show the About dialog | ||
| 56 | Wx::AboutBox($about); | ||
| 57 | |||
| 58 | return; | ||
| 59 | } | ||
| 60 | |||
| 61 | 1; | ||
| 62 | |||
| 63 | |||
| 64 | |||
| 65 | =pod | ||
| 66 | |||
| 67 | =head1 NAME | ||
| 68 | |||
| 69 | Padre::Plugin::ClassSniff - Simple Class::Sniff interface for Padre | ||
| 70 | |||
| 71 | =head1 VERSION | ||
| 72 | |||
| 73 | version 0.30 | ||
| 74 | |||
| 75 | =head1 SYNOPSIS | ||
| 76 | |||
| 77 | Use this like any other Padre plugin. To install | ||
| 78 | Padre::Plugin::ClassSniff for your user only, you can | ||
| 79 | type the following in the extracted F<Padre-Plugin-ClassSniff-...> | ||
| 80 | directory: | ||
| 81 | |||
| 82 | perl Makefile.PL | ||
| 83 | make | ||
| 84 | make test | ||
| 85 | make installplugin | ||
| 86 | |||
| 87 | Afterwards, you can enable the plugin from within Padre | ||
| 88 | via the menu I<Plugins-E<gt>Plugin Manager> and there click | ||
| 89 | I<enable> for I<Class::Sniff>. | ||
| 90 | |||
| 91 | =head1 DESCRIPTION | ||
| 92 | |||
| 93 | This module adds very, very basic support for running Class::Sniff | ||
| 94 | with the default settings against the document (assumed to be a class) | ||
| 95 | in the current editor tab. | ||
| 96 | |||
| 97 | The output will go to the Padre output window. | ||
| 98 | |||
| 99 | TODO: Configuration | ||
| 100 | |||
| 101 | =head1 BUGS | ||
| 102 | |||
| 103 | Please report any bugs or feature requests to L<http://padre.perlide.org/> | ||
| 104 | |||
| 105 | =head1 COPYRIGHT & LICENSE | ||
| 106 | |||
| 107 | Copyright 2009 The Padre development team as listed in Padre.pm. | ||
| 108 | all rights reserved. | ||
| 109 | |||
| 110 | This program is free software; you can redistribute it and/or modify it | ||
| 111 | under the same terms as Perl itself. | ||
| 112 | |||
| 113 | =head1 AUTHORS | ||
| 114 | |||
| 115 | =over 4 | ||
| 116 | |||
| 117 | =item * | ||
| 118 | |||
| 119 | Steffen Mueller <smueller@cpan.org> | ||
| 120 | |||
| 121 | =item * | ||
| 122 | |||
| 123 | Ahmad M. Zawawi <ahmad.zawawi@gmail.com> | ||
| 124 | |||
| 125 | =back | ||
| 126 | |||
| 127 | =head1 COPYRIGHT AND LICENSE | ||
| 128 | |||
| 129 | This software is copyright (c) 2010 by Steffen Mueller. | ||
| 130 | |||
| 131 | This is free software; you can redistribute it and/or modify it under | ||
| 132 | the same terms as the Perl 5 programming language system itself. | ||
| 133 | |||
| 134 | =cut | ||
| 135 | |||
| 136 | |||
| 137 | __END__ |