From f12defd06dfab84dd5a6a1d6f9839d6bb3af2c62 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 26 May 2019 09:20:32 +0300 Subject: Config::HAProxy version 1.03 --- Changes | 6 ++++++ lib/Config/HAProxy.pm | 18 ++++++++++-------- t/Test/HAProxy.pm | 1 - 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index 2fe0426..5bb1939 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ Revision history for Perl extension Config::HAProxy. +1.03 Sun May 26 09:12:10 2019 + - implement configuration syntax check + +1.02 Mon Jul 16 07:38:31 2018 + - remove the leftover use of autodie + 1.01 Thu Jul 12 09:04:28 2018 - set minimal required Perl version - drop dependency on autodie diff --git a/lib/Config/HAProxy.pm b/lib/Config/HAProxy.pm index ff4fa8a..794a80f 100644 --- a/lib/Config/HAProxy.pm +++ b/lib/Config/HAProxy.pm @@ -16,7 +16,7 @@ use File::Spec; use IPC::Cmd; use Carp; -our $VERSION = '1.01'; +our $VERSION = '1.03'; my %sections = ( global => 1, @@ -429,10 +429,11 @@ Returns the last node in the tree. =head2 lint - $cfg->lint(%ARGS); + $cfg->lint(%hash); -Configures syntax checking program to be run before saving. Takes a -hash as argument. Allowed keys are: +Configures configuration syntax check. The check will be run by the B +method prior to writing to the configuration file. Takes a hash as argument. +Allowed keys are: =over 4 @@ -442,7 +443,8 @@ If I is 0, disables syntax check. Default is 1. =item B I> -Configures the command to use for syntax check. The command will be run as +Defines the shell command to use for syntax check. The command will be run +as CMD FILE @@ -452,7 +454,7 @@ Default command is B. =item B I> -Sets the search path for the check program. I is a colon-delimited +Sets the search path for the syntax checker. I is a colon-delimited list of directories. Unless the first word of B is an absolute file name, it will be looked for in these directories. The first match will be used. Default is system B<$PATH>. @@ -467,8 +469,8 @@ Returns the command name. Saves the parse tree in the configuration file. Syntax check will be run prior to saving (unless previously disabled). If syntax errors are discovered, -the method will B with the appropriate diagnostics, beginning with -words C. +the method will B with a diagnostic message starting with words +C. If I<%hash> contains a non-zero B value, B will only run syntax check, without actually saving the file. If B<$cfg-Elint(enable =E 0)> diff --git a/t/Test/HAProxy.pm b/t/Test/HAProxy.pm index b5b8a19..ca7d8ce 100644 --- a/t/Test/HAProxy.pm +++ b/t/Test/HAProxy.pm @@ -4,7 +4,6 @@ use warnings; use parent 'Config::HAProxy'; use File::Basename; use File::Temp; -use autodie; sub new { my $class = shift; -- cgit v1.2.1