Catalyst.pm untested

filter: Statementstmt 0.0% 0 / 285 Branchbran 0.0% 0 / 38 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 43 Podpod 0.0% 0 / 18 totaltotal 0.0% 0 / 396 CC 20 SCAR 21.7
CC
20
Cov
0%
event_on_context_menu
30.0
_open_template
20.0
on_start_server
20.0
CRAP 8.7
1 package Padre::Plugin::Catalyst;
2 BEGIN {
3 $Padre::Plugin::Catalyst::VERSION = '0.13';
4 }
5  
6 # ABSTRACT: Catalyst helper interface for Padre
7  
8 use warnings;
9 use strict;
10  
11 use Padre::Perl ();
12  
13 use base 'Padre::Plugin';
14  
15 # The plugin name to show in the Plugin Manager and menus
16 sub plugin_name {'Catalyst'}
17  
18 # Declare the Padre interfaces this plugin uses
19 sub padre_interfaces {
20 'Padre::Plugin' => 0.47,;
21 }
22  
23 sub plugin_icon {
24 my $icon = [
25 '16 16 46 1', ' c None', '. c #D15C5C', '+ c #E88888', '@ c #E10000',
26 '# c #D03131', '$ c #D26262', '% c #D26161', '& c #E99F9F', '* c #EFACAC',
27 '= c #EFADAD', '- c #E79090', '; c #D14949', '> c #D22727', ', c #E26666',
28 '\' c #E26363', ') c #E26464', '! c #D42A2A', '~ c #D40101', '{ c #D50B0B',
29 '] c #D71313', '^ c #D50C0C', '/ c #D40404', '( c #D26767', '_ c #DF5353',
30 ': c #E15B5B', '< c #D95D5D', '[ c #D21313', '} c #D30000', '| c #DA0000',
31 '1 c #D90000', '2 c #D31111', '3 c #D14646', '4 c #DC1313', '5 c #EC0000',
32 '6 c #E20000', '7 c #F00000', '8 c #F20000', '9 c #D33232', '0 c #D64646',
33 'a c #D46969', 'b c #D35555', 'c c #D23A3A', 'd c #E89090', 'e c #E98E8E',
34 'f c #D60000', 'g c #D70101', ' ', ' . ',
35 ' + ', ' @# ', ' ', ' ',
36 ' $% ', ' &*=-; ', ' >,\'\')! ', ' ~{]]^/ ',
37 '(_: < [}|1}2 ', '345 67869 ', ' 0a b c ', ' de',
38 ' fg', ' ',
39 ];
40 return Wx::Bitmap->newFromXPM($icon);
41 }
42  
43  
44 # we used to be happy and innocent users of
45 # menu_plugins_simple() interface, until we figured
46 # we needed to disable one of the menu items upon startup.
47 # Currently the only way (to our knowledge) to do so
48 # is to loose the "simple" interface and go hardcore
49 # with menu_plugins(). However, this did rose the issue
50 # that maybe there should be a quick access to plugin
51 # menus, and/or an extra parameter to simple() that would
52 # set the menu item as disabled.
53 #
54 # another thing that isn't currently found is an event hook to
55 # document change, like the one that shows/hides the "Perl" menu.
56 # having this to plugins would be sweet, or at least a menu
57 # construction hook called just before the menu is displayed,
58 # like a menu_plugins_on_sight() :)
59  
60 sub menu_plugins {
61 my $self = shift;
62 my $main = shift;
63  
64 # Create a simple menu with a single About entry
65 my $menu = Wx::Menu->new;
66 Wx::Event::EVT_MENU(
67 $main,
68 $menu->Append( -1, Wx::gettext('New Catalyst Application') ),
69 sub {
70 require Padre::Plugin::Catalyst::NewApp;
71 Padre::Plugin::Catalyst::NewApp::on_newapp();
72 return;
73 },
74 );
75 my $menu_new = Wx::Menu->new;
76 $menu->Append( -1, Wx::gettext('Create new...'), $menu_new );
77 Wx::Event::EVT_MENU(
78 $main,
79 $menu_new->Append( -1, Wx::gettext('Model') ),
80 sub {
81 require Padre::Plugin::Catalyst::Helper;
82 Padre::Plugin::Catalyst::Helper::on_create_model();
83 },
84 );
85 Wx::Event::EVT_MENU(
86 $main,
87 $menu_new->Append( -1, Wx::gettext('View') ),
88 sub {
89 require Padre::Plugin::Catalyst::Helper;
90 Padre::Plugin::Catalyst::Helper::on_create_view();
91 },
92 );
93 Wx::Event::EVT_MENU(
94 $main,
95 $menu_new->Append( -1, Wx::gettext('Controller') ),
96 sub {
97 require Padre::Plugin::Catalyst::Helper;
98 Padre::Plugin::Catalyst::Helper::on_create_controller();
99 },
100 );
101  
102 $menu->AppendSeparator;
103 Wx::Event::EVT_MENU(
104 $main,
105 $menu->Append( -1, Wx::gettext('Start Web Server') ),
106 sub { $self->on_start_server },
107 );
108  
109 # when we start the plugin, the "stop web server" option
110 # is disabled.
111 my $stop_server_item = $menu->Append( -1, Wx::gettext('Stop Web Server') );
112 Wx::Event::EVT_MENU(
113 $main,
114 $stop_server_item,
115 sub { $self->on_stop_server },
116 );
117 $stop_server_item->Enable(0);
118  
119 $menu->AppendSeparator;
120 my $docs_menu = Wx::Menu->new;
121 $menu->Append( -1, Wx::gettext('Catalyst Online References'), $docs_menu );
122  
123 my $tutorial_menu = Wx::Menu->new;
124 $docs_menu->Append( -1, Wx::gettext('Beginner\'s Tutorial'), $tutorial_menu );
125 Wx::Event::EVT_MENU(
126 $main,
127 $tutorial_menu->Append( -1, Wx::gettext('Overview') ),
128 sub {
129 Padre::Wx::launch_browser('http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial');
130 },
131 );
132  
133 Wx::Event::EVT_MENU(
134 $main,
135 $tutorial_menu->Append( -1, Wx::gettext('1. Introduction') ),
136 sub {
137 Padre::Wx::launch_browser('http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial::01_Intro');
138 },
139 );
140 Wx::Event::EVT_MENU(
141 $main,
142 $tutorial_menu->Append( -1, Wx::gettext('2. Catalyst Basics') ),
143 sub {
144 Padre::Wx::launch_browser('http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial::02_CatalystBasics');
145 },
146 );
147 Wx::Event::EVT_MENU(
148 $main,
149 $tutorial_menu->Append( -1, Wx::gettext('3. More Catalyst Basics') ),
150 sub {
151 Padre::Wx::launch_browser(
152 'http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial::03_MoreCatalystBasics');
153 },
154 );
155 Wx::Event::EVT_MENU(
156 $main,
157 $tutorial_menu->Append( -1, Wx::gettext('4. Basic CRUD') ),
158 sub {
159 Padre::Wx::launch_browser('http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial::04_BasicCRUD');
160 },
161 );
162 Wx::Event::EVT_MENU(
163 $main,
164 $tutorial_menu->Append( -1, Wx::gettext('5. Authentication') ),
165 sub {
166 Padre::Wx::launch_browser('http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial::05_Authentication');
167 },
168 );
169 Wx::Event::EVT_MENU(
170 $main,
171 $tutorial_menu->Append( -1, Wx::gettext('6. Authorization') ),
172 sub {
173 Padre::Wx::launch_browser('http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial::06_Authorization');
174 },
175 );
176 Wx::Event::EVT_MENU(
177 $main,
178 $tutorial_menu->Append( -1, Wx::gettext('7. Debugging') ),
179 sub {
180 Padre::Wx::launch_browser('http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial::07_Debugging');
181 },
182 );
183 Wx::Event::EVT_MENU(
184 $main,
185 $tutorial_menu->Append( -1, Wx::gettext('8. Testing') ),
186 sub {
187 Padre::Wx::launch_browser('http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial::08_Testing');
188 },
189 );
190 Wx::Event::EVT_MENU(
191 $main,
192 $tutorial_menu->Append( -1, Wx::gettext('9. Advanced CRUD') ),
193 sub {
194 Padre::Wx::launch_browser('http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial::09_AdvancedCRUD');
195 },
196 );
197 Wx::Event::EVT_MENU(
198 $main,
199 $tutorial_menu->Append( -1, Wx::gettext('10. Appendices') ),
200 sub {
201 Padre::Wx::launch_browser('http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial::10_Appendices');
202 },
203 );
204  
205 Wx::Event::EVT_MENU(
206 $main,
207 $docs_menu->Append( -1, Wx::gettext('Catalyst Cookbook') ),
208 sub {
209 Padre::Wx::launch_browser('http://search.cpan.org/perldoc?Catalyst::Manual::Cookbook');
210 },
211 );
212 Wx::Event::EVT_MENU(
213 $main,
214 $docs_menu->Append( -1, Wx::gettext('Recommended Plugins') ),
215 sub {
216 Padre::Wx::launch_browser('http://dev.catalystframework.org/wiki/recommended_plugins');
217 },
218 );
219 Wx::Event::EVT_MENU(
220 $main,
221 $docs_menu->Append( -1, Wx::gettext('Catalyst Community Live Support') ),
222 sub {
223 Padre::Wx::launch_irc( 'irc.perl.org' => 'catalyst' );
224 },
225 );
226  
227 Wx::Event::EVT_MENU(
228 $main,
229 $docs_menu->Append( -1, Wx::gettext('Examples') ),
230 sub {
231 Padre::Wx::launch_browser('http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/');
232 },
233 );
234  
235 Wx::Event::EVT_MENU(
236 $main,
237 $docs_menu->Append( -1, Wx::gettext('Catalyst Wiki') ),
238 sub {
239 Padre::Wx::launch_browser('http://dev.catalystframework.org/wiki/');
240 },
241 );
242 Wx::Event::EVT_MENU(
243 $main,
244 $docs_menu->Append( -1, Wx::gettext('Catalyst Website') ),
245 sub {
246 Padre::Wx::launch_browser('http://www.catalystframework.org/');
247 },
248 );
249  
250 $menu->AppendSeparator;
251 Wx::Event::EVT_MENU(
252 $main,
253 $menu->Append( -1, Wx::gettext('Update Application Scripts') ),
254 sub { $self->on_update_script },
255 );
256  
257 $menu->AppendSeparator;
258 Wx::Event::EVT_MENU(
259 $main,
260 $menu->Append( -1, Wx::gettext('About') ),
261 sub { $self->on_show_about },
262 );
263  
264 # Return it and the label for our plug-in
265 return ( $self->plugin_name => $menu );
266  
267 #TODO: add status bar comment for each menu entry.
268 # look into Padre::Wx::Menu and wxWidgets for $item->SetHelp('foo')
269 }
270  
271  
272 sub event_on_context_menu {
273 my ( $self, $document, $editor, $menu, $event ) = (@_);
274  
275 my $pos;
276 if ( $event->isa("Wx::MouseEvent") ) {
277 my $point = $event->GetPosition();
278 if ( $point != Wx::wxDefaultPosition ) {
279  
280 # Then it is really a mouse event...
281 # On Windows, context menu is faked
282 # as a Mouse event
283 $pos = $editor->PositionFromPoint($point);
284 }
285 }
286  
287 # Fall back to the cursor position if necessary
288 $pos = $editor->GetCurrentPos() unless ($pos);
289  
290 my $template = _get_template( $editor, $pos );
291 if ($template) {
292 $menu->AppendSeparator;
293 my $item = $menu->Append(
294 -1,
295 sprintf( Wx::gettext("Open Template '%s'"), $template ),
296 );
297 Wx::Event::EVT_MENU(
298 $self->main,
299 $item,
300 sub { \&_open_template( shift, $template ) },
301 );
302 }
303  
304 }
305  
306 sub _open_template {
307 my ( $main, $template ) = (@_);
308  
309 require File::Spec;
310 require File::Find;
311 require Padre::Plugin::Catalyst::Util;
312  
313 my $project_dir = Padre::Plugin::Catalyst::Util::get_document_base_dir() || return;
314 my $template_dir = File::Spec->catdir( $project_dir, 'root' );
315  
316 my @files;
317 File::Find::find(
318 sub {
319 if ( $File::Find::name =~ /$template$/ ) {
320 push @files, $File::Find::name;
321 }
322 },
323 $template_dir
324 );
325  
326 unless (@files) {
327 Wx::MessageBox(
328 sprintf(
329 Wx::gettext("Template '%s' not found in '%s'"),
330 $template, $template_dir
331 ),
332 Wx::gettext('Error'),
333 Wx::wxOK, $main
334 );
335 }
336  
337 # if we get over one result, we default to the
338 # shortest path
339 my $file = shift @files;
340 foreach (@files) {
341 $file = $_ if length($file) > length($_);
342 }
343 $main->setup_editors($file);
344 }
345  
346 sub _get_template {
347 my ( $editor, $pos ) = (@_);
348  
349 my $line = $editor->LineFromPosition($pos);
350 my $line_start = $editor->PositionFromLine($line);
351 my $line_end = $editor->GetLineEndPosition($line);
352 my $cursor_col = $pos - $line_start;
353 my $line_content = $editor->GetTextRange( $line_start, $line_end );
354  
355 #TODO: improve template detection
356 if ( $line_content =~ /([\/\w]+\.tt\d?)/ ) {
357 return $1;
358 }
359 }
360  
361 sub on_update_script {
362 my $main = Padre->ide->wx->main;
363  
364 require File::Spec;
365 require Padre::Plugin::Catalyst::Util;
366 my $project_dir = Padre::Plugin::Catalyst::Util::get_document_base_dir() || return;
367  
368 my @dir = File::Spec->splitdir($project_dir);
369 my $project = $dir[-1];
370 $project =~ s{-}{::}g;
371  
372 # go to the selected file's PARENT directory
373 # (so we can run catalyst.pl on the project dir)
374 my $pwd = Cwd::cwd();
375 chdir $project_dir;
376 chdir File::Spec->updir;
377  
378 require Padre::Constant;
379 require File::Which;
380 my $catalyst = Padre::Constant::WIN32 ? File::Which::which('catalyst') : 'catalyst.pl';
381 $main->run_command("$catalyst -force -scripts $project");
382  
383 # restore current dir
384 chdir $pwd;
385 }
386  
387 sub on_start_server {
388 my $self = shift;
389  
390 #TODO FIXME: if the user closed the panel,
391 # how do we know? and how do we show it again?
392 # as it is, Padre crashes :(
393 #Padre::Current->main->bottom->show($self->panel);
394  
395 my $main = Padre->ide->wx->main;
396  
397 require File::Spec;
398 require Padre::Plugin::Catalyst::Util;
399 my $project_dir = Padre::Plugin::Catalyst::Util::get_document_base_dir() || return;
400  
401 my $server_filename = Padre::Plugin::Catalyst::Util::get_catalyst_project_name($project_dir);
402  
403 $server_filename .= '_server.pl';
404  
405 my $server_full_path = File::Spec->catfile( $project_dir, 'script', $server_filename );
406 if ( !-e $server_full_path ) {
407 Wx::MessageBox(
408 sprintf(
409 Wx::gettext(
410 "Catalyst development web server not found at\n%s\n\nPlease make sure the active document is from your Catalyst project."
411 ),
412 $server_full_path
413 ),
414 Wx::gettext('Server not found'),
415 Wx::wxOK, $main
416 );
417 return;
418 }
419  
420 # go to the selected file's directory
421 # (catalyst instructs us to always run their scripts
422 # from the basedir)
423 my $pwd = Cwd::cwd();
424 chdir $project_dir;
425  
426 my $perl = Padre::Perl->perl;
427 my $command = "$perl " . File::Spec->catfile( 'script', $server_filename );
428 $command .= ' -r ' if $self->panel->{checkbox}->IsChecked;
429  
430 #$main->run_command($command);
431 # somewhat the same as $main->run_command,
432 # but in our very own panel, and with our own rigs
433 $self->run_command($command);
434  
435 # restore current dir
436 chdir $pwd;
437  
438 # handle menu graying
439 Padre::Plugin::Catalyst::Util::toggle_server_menu(0);
440 $self->panel->toggle_panel(0);
441  
442 # TODO: actually check whether this is true.
443 my $ret = Wx::MessageBox(
444 Wx::gettext('Web server appears to be running. Launch web browser now?'),
445 Wx::gettext('Start Web Browser?'),
446 Wx::wxYES_NO | Wx::wxCENTRE,
447 $main,
448 );
449 if ( $ret == Wx::wxYES ) {
450 Padre::Wx::launch_browser('http://localhost:3000');
451 }
452  
453 return;
454 }
455  
456  
457 ### run_command() adapted from Padre::Wx::Main's version
458 sub run_command {
459 my ( $self, $command ) = (@_);
460  
461 # clear the panel
462 $self->panel->output->Remove( 0, $self->panel->output->GetLastPosition );
463  
464 # If this is the first time a command has been run,
465 # set up the ProcessStream bindings.
466 unless ($Wx::Perl::ProcessStream::VERSION) {
467 require Wx::Perl::ProcessStream;
468 if ( $Wx::Perl::ProcessStream::VERSION < .20 ) {
469 $self->main->error(
470 sprintf(
471 Wx::gettext(
472 'Wx::Perl::ProcessStream is version %s'
473 . ' which is known to cause problems. Get at least 0.20 by typing'
474 . "\ncpan Wx::Perl::ProcessStream"
475 ),
476 $Wx::Perl::ProcessStream::VERSION
477 )
478 );
479 return 1;
480 }
481  
482 Wx::Perl::ProcessStream::EVT_WXP_PROCESS_STREAM_STDOUT(
483 $self->panel->output,
484 sub {
485 $_[1]->Skip(1);
486 my $outpanel = $_[0]; #->{panel};
487 $outpanel->style_good;
488 $outpanel->AppendText( $_[1]->GetLine . "\n" );
489 return;
490 },
491 );
492 Wx::Perl::ProcessStream::EVT_WXP_PROCESS_STREAM_STDERR(
493 $self->panel->output,
494 sub {
495 $_[1]->Skip(1);
496 my $outpanel = $_[0]; #->{panel};
497 $outpanel->style_neutral;
498 $outpanel->AppendText( $_[1]->GetLine . "\n" );
499  
500 return;
501 },
502 );
503 Wx::Perl::ProcessStream::EVT_WXP_PROCESS_STREAM_EXIT(
504 $self->panel->output,
505 sub {
506 $_[1]->Skip(1);
507 $_[1]->GetProcess->Destroy;
508 delete $self->{server};
509 },
510 );
511 }
512  
513 # Start the command
514 my $process = Wx::Perl::ProcessStream::Process->new(
515 $command,
516 "Run $command",
517 $self->panel->output
518 );
519 $self->{server} = $process->Run;
520  
521 # Check if we started the process or not
522 unless ( $self->{server} ) {
523  
524 # Failed to start the command. Clean up.
525 Wx::MessageBox(
526 sprintf( Wx::gettext("Failed to start server via '%s'"), $command ),
527 Wx::gettext("Error"), Wx::wxOK, $self
528 );
529  
530 # $self->menu->run->enable;
531 }
532  
533 return;
534 }
535  
536 sub on_stop_server {
537 my $self = shift;
538  
539 #TODO FIXME: if the user closed the panel,
540 # how do we know? and how do we show it again?
541 # as it is, Padre crashes :(
542 #Padre::Current->main->bottom->show($self->panel);
543  
544 if ( $self->{server} ) {
545 my $processid = $self->{server}->GetProcessId();
546 kill( 9, $processid );
547  
548 #$self->{server}->TerminateProcess;
549 }
550 delete $self->{server};
551  
552 $self->panel->output->AppendText( "\n" . Wx::gettext('Web server stopped successfully.') . "\n" );
553  
554 # handle menu graying
555 require Padre::Plugin::Catalyst::Util;
556 Padre::Plugin::Catalyst::Util::toggle_server_menu(1);
557 $self->panel->toggle_panel(1);
558  
559 return;
560 }
561  
562 sub on_show_about {
563 require Catalyst;
564 require Class::Unload;
565 my $about = Wx::AboutDialogInfo->new;
566 $about->SetName("Padre::Plugin::Catalyst");
567 $about->SetDescription( Wx::gettext('Catalyst support for Padre') . "\n\n"
568 . Wx::gettext('This system is running Catalyst version')
569 . " $Catalyst::VERSION\n" );
570 $about->SetVersion($Padre::Plugin::Catalyst::VERSION);
571 Class::Unload->unload('Catalyst');
572  
573 Wx::AboutBox($about);
574 return;
575 }
576  
577 sub plugin_enable {
578 my $self = shift;
579  
580 require Padre::Plugin::Catalyst::Panel;
581 $self->{panel} = Padre::Plugin::Catalyst::Panel->new($self);
582  
583 Padre::Current->main->bottom->show( $self->{panel} );
584  
585 # load Catalyst main menu
586 $self->editor_changed;
587  
588 # TODO: Please uncomment this to test the Catalyst side-panel
589 # require Padre::Plugin::Catalyst::Outline;
590 # $self->{outline} = Padre::Plugin::Catalyst::Outline->new($self);
591  
592 }
593  
594 sub panel { return shift->{panel} }
595  
596 sub plugin_disable {
597 my $self = shift;
598  
599 # $self->panel->Destroy;
600 Padre::Current->main->bottom->hide( $self->{panel} );
601 $self->on_stop_server;
602  
603  
604 # cleanup loaded classes
605 require Class::Unload;
606 Class::Unload->unload('Padre::Plugin::Catalyst::NewApp');
607 Class::Unload->unload('Padre::Plugin::Catalyst::Helper');
608 Class::Unload->unload('Padre::Plugin::Catalyst::Util');
609 Class::Unload->unload('Padre::Plugin::Catalyst::Panel');
610 Class::Unload->unload('Catalyst');
611 }
612  
613 # FIXME: Padre does *NOT* seem to call this if a document is closed.
614 sub editor_changed {
615 my $self = shift;
616 my $document = $self->main->current->document || return $self->enable(0);
617  
618 #$document->{menu} = [] if (!defined($document->{menu})) or (ref($document->{menu}) ne 'ARRAY');
619 #$document->{menu} = [grep (!/^menu\.Catalyst$/,@{$document->{menu}}) ];
620  
621 # when not inside a catalyst project, disable stuff
622 my $toggle = 0;
623 require Padre::Plugin::Catalyst::Util;
624 if ( Padre::Plugin::Catalyst::Util::in_catalyst_project( $document->filename ) ) {
625  
626 # enable Catalyst main menu
627 #push @{$document->{menu}}, 'menu.Catalyst';
628 $toggle = 1;
629 }
630  
631 # enable/disable Catalyst panel and menu entries
632 $self->enable($toggle);
633 }
634  
635 # this method is invoked when the active document
636 # is **NOT** part of a Catalyst project
637 sub enable {
638 my ( $self, $toggle ) = (@_);
639 my $is_server_on = ( defined $self->{server} ? 1 : 0 );
640  
641 # freeze menu entries
642 # FIXME: this isn't working during startup
643 require Padre::Plugin::Catalyst::Util;
644 Padre::Plugin::Catalyst::Util::toggle_menu_items( $toggle, $is_server_on );
645  
646 # freeze the panel
647 $self->panel->{button}->Enable($toggle);
648 unless ($is_server_on) {
649 $self->panel->{checkbox}->Enable($toggle);
650 }
651 }
652  
653 1;
654  
655  
656  
657 =pod
658  
659 =head1 NAME
660  
661 Padre::Plugin::Catalyst - Catalyst helper interface for Padre
662  
663 =head1 VERSION
664  
665 version 0.13
666  
667 =head1 SYNOPSIS
668  
669 cpan install Padre::Plugin::Catalyst;
670  
671 Then use it via L<Padre>, The Perl IDE.
672  
673 =head1 DESCRIPTION
674  
675 As all Padre plugins, after installation you need to enable it via "Plugins->Plugin Manager".
676  
677 Once you enable it, you should see a 'Catalyst Dev Server' panel on the bottom of your screen (probably next to your 'output' tab). This panel lets you start/stop your application's development server, and also set the auto-restart option for the server to reload itself whenever you change your application's modules or configuration files.
678  
679 You'll also get a brand new menu (Plugins->Catalyst) with the following options:
680  
681 =head2 'New Catalyst Application'
682  
683 This options lets you create a new Catalyst application.
684  
685 =head2 'Create new...'
686  
687 The Catalyst helper lets you automatically create stub classes for your application's MVC components. With this menu option not only can you select your component's name but also its type. For instance, if you select "create new view" and have the L<Catalyst::Helper::View::TT> module installed on your system, the "TT" type will be available for you).
688  
689 Of course, the available components are:
690  
691 =over 4
692  
693 =item * 'Model'
694  
695 =item * 'View'
696  
697 =item * 'Controller'
698  
699 =back
700  
701 =head2 'Start Web Server'
702  
703 This option will automatically spawn your application's development web server. Once it's started, it will ask to open your default web browser to view your application running.
704  
705 The server output should appear in your "Catalyst Dev Server" panel.
706  
707 =head2 'Stop Web Server'
708  
709 This option will stop the development web server for you.
710  
711 =head2 'Catalyst Online References'
712  
713 This menu option contains a series of external reference links on Catalyst. Clicking on each of them will point your default web browser to their websites.
714  
715 =head2 'Update Application Scripts'
716  
717 This option lets you update your application's scripts, upgrading it to a new version of Catalyst (if available)
718  
719 =head2 'About'
720  
721 Shows a nice about box with this module's name and version, as well as your installed Catalyst version.
722  
723 =head1 IDEAS WANTED!
724  
725 How can this Plugin further improve your Catalyst development experience? Please let us know! We are always looking for new ideas and wishlists on how to improve it even more, so drop us a line via email, RT or by joining us via IRC in #padre, right at irc.perl.org (if you are using Padre, you can do this by choosing 'Help->Live Support->Padre Support').
726  
727 =head1 TRANSLATIONS
728  
729 This plugin has been translated to the folowing languages (alphabetic order):
730  
731 =over 4
732  
733 =item Arabic (AZAWAWI)
734  
735 =item Brazilian Portuguese (GARU)
736  
737 =item Chinese (Traditional) (BLUET)
738  
739 =item Dutch (DDN)
740  
741 =item French (JQUELIN)
742  
743 =item German (SEWI)
744  
745 =item Japanese (ISHIGAKI)
746  
747 =item Polish (THEREK)
748  
749 =item Russian (SHARIFULN)
750  
751 =item Spanish (BRUNOV)
752  
753 =back
754  
755 Many thanks to all contributors!
756  
757 Feel free to help if you find any of the translations need improvement/updating, or if you can add more languages to this list. Thanks!
758  
759 =head1 BUGS
760  
761 Please report any bugs or feature requests to C<bug-padre-plugin-catalyst at rt.cpan.org>, or through
762 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Padre-Plugin-Catalyst>. I will be notified, and then you'll
763 automatically be notified of progress on your bug as I make changes.
764  
765 =head1 SUPPORT
766  
767 You can find documentation for this module with the perldoc command.
768  
769 perldoc Padre::Plugin::Catalyst
770  
771 You can also look for information at:
772  
773 =over 4
774  
775 =item * RT: CPAN's request tracker
776  
777 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Padre-Plugin-Catalyst>
778  
779 =item * AnnoCPAN: Annotated CPAN documentation
780  
781 L<http://annocpan.org/dist/Padre-Plugin-Catalyst>
782  
783 =item * CPAN Ratings
784  
785 L<http://cpanratings.perl.org/d/Padre-Plugin-Catalyst>
786  
787 =item * Search CPAN
788  
789 L<http://search.cpan.org/dist/Padre-Plugin-Catalyst/>
790  
791 =back
792  
793 =head1 SEE ALSO
794  
795 L<Catalyst>, L<Padre>
796  
797 =head1 AUTHORS
798  
799 =over 4
800  
801 =item *
802  
803 Breno G. de Oliveira <garu@cpan.org>
804  
805 =item *
806  
807 Ahmad M. Zawawi <ahmad.zawawi@gmail.com>
808  
809 =back
810  
811 =head1 COPYRIGHT AND LICENSE
812  
813 This software is copyright (c) 2010 by Breno G. de Oliveira.
814  
815 This is free software; you can redistribute it and/or modify it under
816 the same terms as the Perl 5 programming language system itself.
817  
818 =cut
819  
820  
821 __END__