Remote/Msoffice.pm

filter: Statementstmt 100% 9 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 12 / 12 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Proxy/Ssh2tcp.pm ↑ Summary Remote/Sandbox.pm »
1 #
2 # $Id$
3 #
4 # remote::msoffice Brik
5 #
6 package Metabrik::Remote::Msoffice;
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use base qw(Metabrik::Remote::Winexe);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub brik_properties {
13 return {
14 revision => '$Revision$',
15 tags => [ qw(unstable) ],
16 author => 'GomoR <GomoR[at]metabrik.org>',
17 license => 'http://opensource.org/licenses/BSD-3-Clause',
18 attributes => {
19 datadir => [ qw(datadir) ],
20 host => [ qw(host) ],
21 user => [ qw(username) ],
22 password => [ qw(password) ],
23 winword_exe_path => [ qw(path) ],
24 },
25 attributes_default => {
26 winword_exe_path => 'C:\Program Files (x86)\Microsoft Office\Office12\WINWORD.EXE',
27 },
28 commands => {
29 install => [ ], # Inherited
30 open_word_document => [ qw(path) ],
31 },
32 };
33 }
34  
35 sub open_word_document {
36 my $self = shift;
37 my ($doc) = @_;
38  
39 $self->brik_help_run_undef_arg('open_word_document', $doc) or return;
40  
41 my $winword_exe_path = $self->winword_exe_path;
42  
43 # winexe -UUSER%PASS //IP '"C:\Program Files (x86)\Microsoft Office\Office12\WINWORD.EXE" "test.docx"'
44 return $self->execute("'\"$winword_exe_path\" \"$doc\"'");
45 }
46  
47 1;
48  
49 __END__
« Proxy/Ssh2tcp.pm ↑ Summary Remote/Sandbox.pm »