Changeset 16595 for misc/runpugs/bin

Show
Ignore:
Timestamp:
06/01/07 18:08:37 (18 months ago)
Author:
andara
Message:

[runpugs] - Settings now go in $HOME/.webtermrc (using Config::General).

Look at webtermrc for example settings.

  • Prompt detection now more robust.
  • Easier back-end testing with command-line REPLs (see /bin).
Location:
misc/runpugs/bin
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • misc/runpugs/bin/perl_repl.pl

    r16228 r16595  
    44#use lib '../lib','/home/andara/lib/perl/5.8.8'; 
    55use Repl; 
    6  
     6my $prompt ='pugs> '; 
     7my $motd ='Simple Perl REPL'; 
    78my $subref = sub { 
    89        my $cmd = shift; 
    910        my $res = eval($cmd); 
    10         return $res; 
     11        return ($res,$prompt); 
    1112}; 
    12 my $prompt ='pugs> '; 
    13 my $motd ='Simple Perl REPL'; 
     13 
    1414 
    1515my $repl = new Repl {subref=>$subref,prompt=>$prompt,motd=>$motd}; 
  • misc/runpugs/bin/test_session.pl

    r16218 r16595  
    1313my $session=create_session($app); 
    1414 
    15 my $subref = sub {my $cmd=shift;my $res=$session->write($cmd);chomp $res; return $res;}; 
     15my $subref = sub {my $cmd=shift;my $res=$session->write($cmd);chomp $res; return ($res,$session->{'prompt'});}; 
    1616 
    1717my $prompt =$session->prompt; 
  • misc/runpugs/bin/test_session_dispatcher.pl

    r16218 r16595  
    77use Web::Terminal::Dispatcher; 
    88$Web::Terminal::Settings::port=2059; 
    9  
    10 my $app=(defined $ARGV[0])?$ARGV[0]:2; 
     9my $app; 
     10if (defined $ARGV[0]){ 
     11        $app=$ARGV[0]; 
     12} else { 
     13die "Usage: $0 app (0|1|2) [id (default 42)].\n"; 
     14} 
    1115my $id=(defined $ARGV[1])?$ARGV[1]:42; 
    1216$id='testsession'.$id; 
     
    1721(my $reply,my $prompt,my $histref) = 
    1822&Web::Terminal::Dispatcher::send($id,$ip,$app,1,$cmd); 
    19 return $reply; 
     23return ($reply,$prompt); 
    2024}; 
    2125