[Jifty-commit] r5162 - in jifty/trunk: lib/Jifty/Script

Jifty commits jifty-commit at lists.jifty.org
Fri Feb 22 05:01:15 EST 2008


Author: sartak
Date: Fri Feb 22 05:01:15 2008
New Revision: 5162

Added:
   jifty/trunk/lib/Jifty/Script/Repl.pm
Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/Makefile.PL

Log:
 r52013 at onn:  sartak | 2008-02-22 05:01:00 -0500
 Add 'jifty repl' which uses the awesome Devel::REPL


Modified: jifty/trunk/Makefile.PL
==============================================================================
--- jifty/trunk/Makefile.PL	(original)
+++ jifty/trunk/Makefile.PL	Fri Feb 22 05:01:15 2008
@@ -154,6 +154,10 @@
         -default => 0,
         recommends('Devel::EvalContext'),
     ],
+    'Jifty REPL' => [
+        -default => 0,
+        recommends('Devel::REPL'), # Devel::REPL::Script
+    ],
     'Chart Plugin (none of these must be installed for Charts to work)' => [
         -default => 0,
         recommends('Chart::Base'),

Added: jifty/trunk/lib/Jifty/Script/Repl.pm
==============================================================================
--- (empty file)
+++ jifty/trunk/lib/Jifty/Script/Repl.pm	Fri Feb 22 05:01:15 2008
@@ -0,0 +1,50 @@
+use strict;
+use warnings;
+
+package Jifty::Script::Repl;
+use base qw/App::CLI::Command/;
+use Devel::REPL::Script;
+
+=head1 NAME
+
+Jifty::Script::Repl - A REPL for your Jifty application
+
+=head1 DESCRIPTION
+
+This gives you a L<Devel::REPL> for your Jifty application. L<Devel::REPL> is a
+powerful and extensible read-eval-print-loop (basically a line-by-line
+interpreter). This command is similar to, but more useful than,
+C<jifty console>. C<jifty console> is literally read-eval-print-loop but without
+any of the nice plugins (such as colors, auto-dump output, interrupt
+long-running commands, autorefresh code each line, etc).
+
+=head1 METHODS
+
+=head2 options()
+
+Returns nothing. This script has no options now. Maybe it will have
+some command lines options in the future.
+
+=cut
+
+sub options { }
+
+=head2 run()
+
+Creates a L<Devel::REPL> object and runs it.
+
+=cut
+
+sub run {
+    my $self = shift;
+    Jifty->new();
+    Devel::REPL::Script->new->run();
+}
+
+1;
+
+=head1 AUTHOR
+
+Shawn M Moore C<<sartak at bestpractical.com>>
+
+=cut


More information about the Jifty-commit mailing list