2 |
## $Id$ |
## $Id$ |
3 |
## ---------------------------------------------------------------------- |
## ---------------------------------------------------------------------- |
4 |
## $Log$ |
## $Log$ |
5 |
|
## Revision 1.6 2003/03/29 07:10:42 joko |
6 |
|
## + sub _script: |
7 |
|
## new rap-command: '<script language="msdos/bat|bash|...">...</script>' |
8 |
|
## |
9 |
|
## Revision 1.5 2003/03/27 15:31:04 joko |
10 |
|
## fixes to modules regarding new namespace(s) below Data::Mungle::* |
11 |
|
## |
12 |
|
## Revision 1.4 2003/02/22 16:48:58 joko |
13 |
|
## modified rapcall behaviour |
14 |
|
## |
15 |
|
## Revision 1.3 2003/02/21 07:39:13 joko |
16 |
|
## modified 'rapcall' processing |
17 |
|
## modified merging of options/arguments in there |
18 |
|
## |
19 |
## Revision 1.2 2003/02/20 19:37:09 joko |
## Revision 1.2 2003/02/20 19:37:09 joko |
20 |
## renamed modules |
## renamed modules |
21 |
## - removed command 'exec' |
## - removed command 'exec' |
40 |
use Hash::Merge qw( merge ); |
use Hash::Merge qw( merge ); |
41 |
|
|
42 |
use DesignPattern::Object; |
use DesignPattern::Object; |
43 |
use Data::Transform::Deep qw( merge_to ); |
use Data::Mungle::Transform::Deep qw( merge_to ); |
44 |
use shortcuts qw( run_cmd ); |
use shortcuts qw( run_cmd ); |
45 |
|
|
46 |
|
|
224 |
my $args = shift; |
my $args = shift; |
225 |
|
|
226 |
if (my $container = $self->getContainer()) { |
if (my $container = $self->getContainer()) { |
227 |
my $opts = merge($container, $args); |
#my $opts = merge($container, $args); |
228 |
if ($opts->{executable}) { |
#print Dumper($container); |
229 |
$self->run_executable($opts); |
merge_to($args, $container, { init => 1 }); |
230 |
} |
} |
231 |
|
|
232 |
|
# trace |
233 |
|
#print Dumper($args); |
234 |
|
|
235 |
#print Dumper($opts); |
if ($args->{executable}) { |
236 |
|
$self->run_executable($args); |
237 |
return; |
return; |
238 |
} |
} |
239 |
|
|
240 |
if (my $command = $args->{command}) { |
if (my $command = $args->{command}) { |
241 |
$self->perform_command($command, $args); |
$self->perform_command($command, $args); |
242 |
|
return; |
243 |
} |
} |
244 |
|
|
245 |
if (my $target = $args->{target}) { |
if (my $target = $args->{target}) { |
246 |
$self->performTarget($target, $args); |
$self->performTarget($target, $args); |
247 |
|
return; |
248 |
} |
} |
249 |
|
|
250 |
if (my $method = $args->{method}) { |
if (my $method = $args->{method}) { |
258 |
} elsif (my $ref = $self->getInstance()) { |
} elsif (my $ref = $self->getInstance()) { |
259 |
$ref->$method(); |
$ref->$method(); |
260 |
} |
} |
261 |
|
|
262 |
|
return; |
263 |
|
|
264 |
} |
} |
265 |
|
|
266 |
} |
} |
277 |
$self->setInstance($self->{$name}) if $args->{type} eq 'instance'; |
$self->setInstance($self->{$name}) if $args->{type} eq 'instance'; |
278 |
} |
} |
279 |
|
|
280 |
|
sub _script { |
281 |
|
my $self = shift; |
282 |
|
my $args = shift; |
283 |
|
my $content = shift; |
284 |
|
|
285 |
|
# trace |
286 |
|
#print Dumper($args); |
287 |
|
#print Dumper($content); |
288 |
|
|
289 |
|
my $code = $content->[0]->{content}; |
290 |
|
$code ||= ''; |
291 |
|
|
292 |
|
$self->run_script($args, $code); |
293 |
|
|
294 |
|
} |
295 |
|
|
296 |
1; |
1; |
297 |
__END__ |
__END__ |