Changeset 36 for server/trunk
- Timestamp:
- 11/25/10 03:34:05 (14 years ago)
- Location:
- server/trunk/web/lib/Sophie
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Controller/Chat.pm
r35 r36 2 2 use Moose; 3 3 use namespace::autoclean; 4 use Getopt::Long;5 use Text::ParseWords;6 4 7 5 BEGIN {extends 'Catalyst::Controller'; } … … 27 25 my ( $self, $c ) = @_; 28 26 29 $c->response->body('Matched Sophie::Controller::Chat in Chat.'); 27 30 28 } 31 29 … … 37 35 38 36 foreach my $co (ref $contexts ? @$contexts : $contexts) { 39 warn $co; 40 if (ref $co) { 37 if (ref($co) eq 'HASH') { 41 38 foreach (keys %$co) { 42 39 $reqspec->{$_} = $co->{$_}; 43 40 } 44 41 } else { 45 if (my $coo = $c->forward('/user/fetchdata', $co)) {42 if (my $coo = $c->forward('/user/fetchdata', [ $co ])) { 46 43 foreach (keys %$coo) { 47 44 $reqspec->{$_} = $coo->{$_}; -
server/trunk/web/lib/Sophie/Controller/User.pm
r35 r36 50 50 my ( $self, $c, $dataname ) = @_; 51 51 52 return $c->forward('fetch_user_data', [ $c->user , $dataname ]);52 return $c->forward('fetch_user_data', [ $c->user || '', $dataname ]); 53 53 } 54 54 -
server/trunk/web/lib/Sophie/Model/Chat.pm
r35 r36 2 2 use Moose; 3 3 use namespace::autoclean; 4 use Getopt::Long; 5 use Text::ParseWords; 4 6 5 7 extends 'Catalyst::Model'; … … 31 33 }, 32 34 t => { 33 code => sub { $_[0]->forward('/distrib/list') }, 35 code => sub { 36 my ($c, $context, @args) = @_; 37 local @ARGV = @args; 38 join(', ', @{ $_[0]->forward('/distrib/list', [ { 39 distribution => $args[0], 40 release => $args[1], 41 arch => $args[2], 42 }, ] 43 ) });; 44 }, 34 45 }, 35 46 }; 36 47 37 48 sub process { 38 my ( $self, $c, $context, $ cmd, @args) = @_;49 my ( $self, $c, $context, $message) = @_; 39 50 40 warn keys %$context;51 my ($cmd, @args) = Text::ParseWords::shellwords($message); 41 52 42 53 my $msg;
Note: See TracChangeset
for help on using the changeset viewer.