Ansible
view release on metacpan or search on metacpan
lib/Ansible.pm view on Meta::CPAN
print STDERR "SET TO {\n@lines\n}\n" if $debug_set;
my $desig = shift(@lines);
my @o;
undef $old
if ! $old;
if ( ! $old ) {
print STDERR "NO OLD\n" if $debug_set;
push(@o, openangle($self->setcontext(@designators)));
push(@o, $desig);
}
elsif ( ! $designator && ! looks_like_a_block($desig, @lines) ) {
if ( $self->block && $self->context ) {
unshift(@lines, $desig);
$old = $self->context;
undef $desig;
}
else {
unshift(@lines, $desig);
print STDERR "IN NASTY BIT\n" if $debug_set;
#
# this is a messy situation: we've got a random
lib/Ansible.pm view on Meta::CPAN
}
push(@o, @lines) if @o;
}
@o = grep (defined, @o);
push(@o, closeangle($self->unsetcontext(@designators)))
if @o;
return join('', returns(@o)) unless wantarray;
return returns(@o);
}
sub looks_like_a_block {
my ($first, @l) = @_;
my $last = pop(@l);
return 1 if ! defined $last;
return 0 if grep (/^\S/, @l);
return 0 if $first =~ /^\s/;
return 0 if $last =~ /^\s/;
return 1;
}
sub iinvert {
( run in 0.373 second using v1.01-cache-2.11-cpan-64827b87656 )