summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Changes4
-rw-r--r--lib/Config/HAProxy.pm3
-rw-r--r--t/format.t17
-rw-r--r--t/select.t1
4 files changed, 10 insertions, 15 deletions
diff --git a/Changes b/Changes
index f67f71f..2fe0426 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
Revision history for Perl extension Config::HAProxy.
+1.01 Thu Jul 12 09:04:28 2018
+ - set minimal required Perl version
+ - drop dependency on autodie
+
1.00 Sun Jul 8 19:57:57 2018
- original revision
diff --git a/lib/Config/HAProxy.pm b/lib/Config/HAProxy.pm
index 74eafa4..9a8d666 100644
--- a/lib/Config/HAProxy.pm
+++ b/lib/Config/HAProxy.pm
@@ -371,7 +371,8 @@ Saves the parse tree in the configuration file.
$cfg->write($file, %hash);
-Writes configuration to the named file or file handle. If B<$file> is the
+Writes configuration to the named file or file handle. First argument
+can be a file name, file handle or a string reference. If it is the
only argument, the original indentation is preserved. Otherwise, if
B<%hash> controls the indentation of the output. It must contain at least
the B<indent> key, which specifies the amount of indentation per nesting
diff --git a/t/format.t b/t/format.t
index 06b9884..2d124fc 100644
--- a/t/format.t
+++ b/t/format.t
@@ -3,7 +3,6 @@ use lib qw(t lib);
use strict;
use warnings;
use Test::More;
-use autodie;
BEGIN {
plan tests => 6;
@@ -14,9 +13,7 @@ my $hp = new Test::HAProxy;
isa_ok($hp,'Test::HAProxy');
my $s;
-open(my $fh, '>', \$s);
-$hp->write($fh);
-close $fh;
+$hp->write(\$s);
is($s, q{global
# comment
@@ -33,9 +30,7 @@ backend out
server localhost http://127.0.0.1
}, 'default write');
-open($fh, '>', \$s);
-$hp->write($fh, indent => 2);
-close $fh;
+$hp->write(\$s, indent => 2);
is($s, q{global
# comment
@@ -52,9 +47,7 @@ backend out
server localhost http://127.0.0.1
}, 'reindent');
-open($fh, '>', \$s);
-$hp->write($fh, indent => 2, reindent_comments => 1);
-close $fh;
+$hp->write(\$s, indent => 2, reindent_comments => 1);
is($s, q{global
# comment
@@ -71,9 +64,7 @@ backend out
server localhost http://127.0.0.1
}, 'reindent comments');
-open($fh, '>', \$s);
-$hp->write($fh, indent => 4, tabstop => [ 10, 24 ]);
-close $fh;
+$hp->write(\$s, indent => 4, tabstop => [ 10, 24 ]);
is($s, q{global
# comment
diff --git a/t/select.t b/t/select.t
index 0be1c9c..1930ff6 100644
--- a/t/select.t
+++ b/t/select.t
@@ -3,7 +3,6 @@ use lib qw(t lib);
use strict;
use warnings;
use Test::More;
-use autodie;
BEGIN {
plan tests => 4;

Return to:

Send suggestions and report system problems to the System administrator.