diff options
| author | franck cuny <franck@lumberjaph.net> | 2010-06-06 16:52:32 +0200 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2010-06-06 16:52:32 +0200 |
| commit | 6754c25c01c202ff788ffba6265d98b4b75f4db4 (patch) | |
| tree | 8ec3b04963a14462a51479555381cdec361f5f43 /lib/Net/HTTP/Console/Dispatcher/LoadLib.pm | |
| download | net-http-console-6754c25c01c202ff788ffba6265d98b4b75f4db4.tar.gz | |
initial commit
Diffstat (limited to 'lib/Net/HTTP/Console/Dispatcher/LoadLib.pm')
| -rw-r--r-- | lib/Net/HTTP/Console/Dispatcher/LoadLib.pm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Net/HTTP/Console/Dispatcher/LoadLib.pm b/lib/Net/HTTP/Console/Dispatcher/LoadLib.pm new file mode 100644 index 0000000..7aac18f --- /dev/null +++ b/lib/Net/HTTP/Console/Dispatcher/LoadLib.pm @@ -0,0 +1,23 @@ +package Net::HTTP::Console::Dispatcher::LoadLib; + +use Moose; +use namespace::autoclean; + +with qw/Net::HTTP::Console::Dispatcher/; + +sub dispatch { + my ($self, $input) = @_; + if (Class::MOP::load_class($input)) { + print "loaded ".$input."\n"; + $self->application->lib($input); + return 1; + } + # XXX error confess & co +} + +sub pattern { + my ($self, $input) = @_; + $input =~ /load\s(.*)$/ ? $1 : 0; +} + +1; |
