| blib/lib/WebEditor/OldFeatures/IndexerLive.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 9 | 25 | 36.0 |
| branch | 0 | 2 | 0.0 |
| condition | n/a | ||
| subroutine | 3 | 4 | 75.0 |
| pod | 0 | 1 | 0.0 |
| total | 12 | 32 | 37.5 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | # -*- perl -*- | ||||||
| 2 | |||||||
| 3 | # | ||||||
| 4 | # $Id: IndexerLive.pm,v 1.3 2005/03/13 17:33:31 cmuellermeta Exp $ | ||||||
| 5 | # Author: Slaven Rezic | ||||||
| 6 | # | ||||||
| 7 | # Copyright (C) 2004 Slaven Rezic. All rights reserved. | ||||||
| 8 | # This package is free software; you can redistribute it and/or | ||||||
| 9 | # modify it under the same terms as Perl itself. | ||||||
| 10 | # | ||||||
| 11 | # Mail: slaven@rezic.de | ||||||
| 12 | # WWW: http://www.rezic.de/eserte/ | ||||||
| 13 | # | ||||||
| 14 | |||||||
| 15 | package WebEditor::OldFeatures::IndexerLive; | ||||||
| 16 | |||||||
| 17 | 1 | 1 | 1158 | use strict; | |||
| 1 | 2 | ||||||
| 1 | 33 | ||||||
| 18 | 1 | 1 | 6 | use vars qw($VERSION); | |||
| 1 | 2 | ||||||
| 1 | 64 | ||||||
| 19 | $VERSION = sprintf("%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/); | ||||||
| 20 | |||||||
| 21 | 1 | 1 | 6 | use mixin::with "WebEditor::OldController"; | |||
| 1 | 2 | ||||||
| 1 | 6 | ||||||
| 22 | |||||||
| 23 | sub run_live_indexer { | ||||||
| 24 | 0 | 0 | 0 | require File::Basename; | |||
| 25 | 0 | require File::Spec; | |||||
| 26 | 0 | my $self = shift; | |||||
| 27 | 0 | my $c = $self->C; | |||||
| 28 | 0 | my $liveuser=$c->staging->user; | |||||
| 29 | |||||||
| 30 | 0 | my @cmd; | |||||
| 31 | |||||||
| 32 | 0 | 0 | unless ("$liveuser"){ | ||||
| 33 | 0 | print "creating Live Index for localhost... \n"; |
|||||
| 34 | 0 | @cmd = (File::Spec->catfile(File::Basename::dirname($c->staging->directory), "etc", "run_indexer")); | |||||
| 35 | |||||||
| 36 | }else{ | ||||||
| 37 | 0 | print "creating Live Index for remote host... \n"; |
|||||
| 38 | 0 | my @cmd = (qw(ssh -l) , $c->staging->user, | |||||
| 39 | $c->staging->host, | ||||||
| 40 | File::Spec->catfile(File::Basename::dirname($c->staging->directory), | ||||||
| 41 | "etc", "run_indexer"), | ||||||
| 42 | ); | ||||||
| 43 | } | ||||||
| 44 | 0 | print ""; |
|||||
| 45 | 0 | print "Run: @cmd\n"; | |||||
| 46 | 0 | system(@cmd); | |||||
| 47 | 0 | print "Exit code: $?\n"; | |||||
| 48 | 0 | print ""; | |||||
| 49 | } | ||||||
| 50 | |||||||
| 51 | 1; | ||||||
| 52 | |||||||
| 53 | __END__ |