Skip to content

Commit

Permalink
Put only one blank line between sections with payloads
Browse files Browse the repository at this point in the history
  • Loading branch information
rwstauner committed Mar 3, 2013
1 parent fc99143 commit 9d428c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Config/MVP/Writer/INI.pm
Expand Up @@ -55,6 +55,8 @@ sub ini_string {

# don't need to start with a newline
$ini =~ s/\A\n+//;
# don't need more than two together (single blank line)
$ini =~ s/(?<=\n\n)\n+//g;
# one newline at the end is sufficient
$ini =~ s/\n*\z/\n/;

Expand Down
9 changes: 9 additions & 0 deletions t/ini.t
Expand Up @@ -45,6 +45,8 @@ run_me({
}],
[Pizza => 'Mod::Pizza' => ],
[Donkey => 'Mod::Donuts' => ],
[CokeBear => 'Mod::CokeBear' => {':version' => '1.002023'}],
[MASH => MASH => {':rum' => 'cookies', section => 8}],
[SomethingElse => {with => 'a config'}],
[AllTheSame => ],
'EvenMore::TheSame' =>
Expand All @@ -62,6 +64,13 @@ orange = beak
[Pizza]
[Donuts / Donkey]
[CokeBear]
:version = 1.002023
[MASH]
:rum = cookies
section = 8
[SomethingElse]
with = a config
Expand Down

0 comments on commit 9d428c8

Please sign in to comment.