diff options
-rw-r--r-- | Changes | 4 | ||||
-rw-r--r-- | lib/Config/HAProxy.pm | 3 | ||||
-rw-r--r-- | t/format.t | 17 | ||||
-rw-r--r-- | t/select.t | 1 |
4 files changed, 10 insertions, 15 deletions
@@ -1,5 +1,9 @@ | |||
1 | Revision history for Perl extension Config::HAProxy. | 1 | Revision history for Perl extension Config::HAProxy. |
2 | 2 | ||
3 | 1.01 Thu Jul 12 09:04:28 2018 | ||
4 | - set minimal required Perl version | ||
5 | - drop dependency on autodie | ||
6 | |||
3 | 1.00 Sun Jul 8 19:57:57 2018 | 7 | 1.00 Sun Jul 8 19:57:57 2018 |
4 | - original revision | 8 | - original revision |
5 | 9 | ||
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. | |||
371 | 371 | ||
372 | $cfg->write($file, %hash); | 372 | $cfg->write($file, %hash); |
373 | 373 | ||
374 | Writes configuration to the named file or file handle. If B<$file> is the | 374 | Writes configuration to the named file or file handle. First argument |
375 | can be a file name, file handle or a string reference. If it is the | ||
375 | only argument, the original indentation is preserved. Otherwise, if | 376 | only argument, the original indentation is preserved. Otherwise, if |
376 | B<%hash> controls the indentation of the output. It must contain at least | 377 | B<%hash> controls the indentation of the output. It must contain at least |
377 | the B<indent> key, which specifies the amount of indentation per nesting | 378 | the B<indent> key, which specifies the amount of indentation per nesting |
@@ -3,7 +3,6 @@ use lib qw(t lib); | |||
3 | use strict; | 3 | use strict; |
4 | use warnings; | 4 | use warnings; |
5 | use Test::More; | 5 | use Test::More; |
6 | use autodie; | ||
7 | 6 | ||
8 | BEGIN { | 7 | BEGIN { |
9 | plan tests => 6; | 8 | plan tests => 6; |
@@ -14,9 +13,7 @@ my $hp = new Test::HAProxy; | |||
14 | isa_ok($hp,'Test::HAProxy'); | 13 | isa_ok($hp,'Test::HAProxy'); |
15 | 14 | ||
16 | my $s; | 15 | my $s; |
17 | open(my $fh, '>', \$s); | 16 | $hp->write(\$s); |
18 | $hp->write($fh); | ||
19 | close $fh; | ||
20 | 17 | ||
21 | is($s, q{global | 18 | is($s, q{global |
22 | # comment | 19 | # comment |
@@ -33,9 +30,7 @@ backend out | |||
33 | server localhost http://127.0.0.1 | 30 | server localhost http://127.0.0.1 |
34 | }, 'default write'); | 31 | }, 'default write'); |
35 | 32 | ||
36 | open($fh, '>', \$s); | 33 | $hp->write(\$s, indent => 2); |
37 | $hp->write($fh, indent => 2); | ||
38 | close $fh; | ||
39 | 34 | ||
40 | is($s, q{global | 35 | is($s, q{global |
41 | # comment | 36 | # comment |
@@ -52,9 +47,7 @@ backend out | |||
52 | server localhost http://127.0.0.1 | 47 | server localhost http://127.0.0.1 |
53 | }, 'reindent'); | 48 | }, 'reindent'); |
54 | 49 | ||
55 | open($fh, '>', \$s); | 50 | $hp->write(\$s, indent => 2, reindent_comments => 1); |
56 | $hp->write($fh, indent => 2, reindent_comments => 1); | ||
57 | close $fh; | ||
58 | 51 | ||
59 | is($s, q{global | 52 | is($s, q{global |
60 | # comment | 53 | # comment |
@@ -71,9 +64,7 @@ backend out | |||
71 | server localhost http://127.0.0.1 | 64 | server localhost http://127.0.0.1 |
72 | }, 'reindent comments'); | 65 | }, 'reindent comments'); |
73 | 66 | ||
74 | open($fh, '>', \$s); | 67 | $hp->write(\$s, indent => 4, tabstop => [ 10, 24 ]); |
75 | $hp->write($fh, indent => 4, tabstop => [ 10, 24 ]); | ||
76 | close $fh; | ||
77 | 68 | ||
78 | is($s, q{global | 69 | is($s, q{global |
79 | # comment | 70 | # comment |
@@ -3,7 +3,6 @@ use lib qw(t lib); | |||
3 | use strict; | 3 | use strict; |
4 | use warnings; | 4 | use warnings; |
5 | use Test::More; | 5 | use Test::More; |
6 | use autodie; | ||
7 | 6 | ||
8 | BEGIN { | 7 | BEGIN { |
9 | plan tests => 4; | 8 | plan tests => 4; |