Skip Menu |

This queue is for tickets about the Config-Std CPAN distribution.

Report information
The Basics
Id: 17794
Status: resolved
Priority: 0/
Queue: Config-Std

People
Owner: Nobody in particular
Requestors: dwheeler [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.007



Subject: New Data Has Too Much Spacing
Date: Tue, 21 Feb 2006 20:44:37 -0800
To: bug-config-std [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
It seems that the default format for the config files that Config::Std creates have two newlines after every entry, unless the entry was ready from a file with some other format. For example, this script: #!/usr/bin/perl -w use strict; use Config::Std; my %config = ( foo => { hey => 'you', dey => 'vous', }, bar => { feh => 'heck', }, ); write_config( %config => shift ); Outputs this config file: [bar] feh: heck [foo] dey: vous hey: you I would much rather that, by default, it put two newlines after every section, and only a single newline after each value. Then it would look like this: [bar] feh: heck [foo] dey: vous hey: you This is much more legible to me, and is more inline with how the vast majority of INI files are arranged. Was there perhaps a reason that you didn't do it this way? Maybe it makes more sense to put two newlines after multi-line config settings (although I should think that indentation would take care of it)? Thanks, David
Subject: Re: [rt.cpan.org #17794] New Data Has Too Much Spacing
Date: Tue, 28 Feb 2006 14:27:59 +1100
To: bug-Config-Std [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Hi David, You suggested: Show quoted text
> I would much rather that, by default, it put two newlines after every > section, and only a single newline after each value. Then it would > look like this: > > > [bar] > feh: heck > > [foo] > dey: vous > hey: you > > This is much more legible to me, and is more inline with how the vast > majority of INI files are arranged. Was there perhaps a reason that > you didn't do it this way? Maybe it makes more sense to put two > newlines after multi-line config settings (although I should think > that indentation would take care of it)?
I previously had it that way, with minimal spacing. I found that it was much harder to read extended config files with all the data bunched up. I guess I could add a configuration option that lets you select how "cuddled" new data is. I'll add that to the ToDo list. Thanks for the feedback, Damian
Subject: Re: [rt.cpan.org #17794] New Data Has Too Much Spacing
Date: Mon, 27 Feb 2006 19:36:10 -0800
To: bug-Config-Std [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
On Feb 27, 2006, at 19:29, damian@conway.org via RT wrote: Show quoted text
> I previously had it that way, with minimal spacing. I found that it > was much > harder to read extended config files with all the data bunched up. > I guess I > could add a configuration option that lets you select how "cuddled" > new data > is. I'll add that to the ToDo list.
Yes, that would work. I think it very much depends on how complicated the config info is. IME, most config files have very short values, or with a few long values but a majority of longer values. Your tests of course have to test outliers, so they'd tend to have longer values. But I think that's not the norm. At any rated, I'd be very happy with a cuddling option. Thanks, David
Subject: Re: [rt.cpan.org #17794] New Data Has Too Much Spacing
Date: Thu, 02 Mar 2006 08:45:56 +1100
To: bug-Config-Std [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
David Wheeler via RT wrote: Show quoted text
>>I guess I could add a configuration option that lets you select how >>"cuddled" new data is.
> > Yes, that would work. I think it very much depends on how complicated > the config info is. IME, most config files have very short values, or > with a few long values but a majority of longer values. Your tests of > course have to test outliers, so they'd tend to have longer values. > But I think that's not the norm. > > At any rated, I'd be very happy with a cuddling option.
Try the attached beta. It adds a 'def_gap' option (described in the POD). It also changes the defaults slightly, to be "semi-cuddly". Hope this helps ;-) Damian

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #17794] New Data Has Too Much Spacing
Date: Wed, 1 Mar 2006 16:15:22 -0800
To: bug-Config-Std [...] rt.cpan.org
From: David Wheeler <dwheeler [...] cpan.org>
On Mar 1, 2006, at 13:46, damian@conway.org via RT wrote: Show quoted text
> Try the attached beta. It adds a 'def_gap' option (described in the > POD). > It also changes the defaults slightly, to be "semi-cuddly". > > Hope this helps ;-)
Yes, I played with it, and it's a big improvement. Thanks! One thing I will comment on, however, is this: Show quoted text
> Regardless of the value passed for C<def_gap>, new multi-line > values are > always written with an empty line above and below them.
I would think that, with the indentation implicit in multiline values, that the lack of an extra space would be no big deal: [contact] address: 742 Evergreen Terrace : Springfield : USA phone: +1 (503) 331-5956 email: david@kineticode.com But since multiline values are comparatively rare, I won't complain if you still want to leave the extra line after them. Thanks! I look forward to the next release. Thanks for being so responsive to my complaints. ;-) David
Subject: Re: [rt.cpan.org #17794] New Data Has Too Much Spacing
Date: Thu, 02 Mar 2006 12:56:33 +1100
To: bug-Config-Std [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> I would think that, with the indentation implicit in multiline > values, that the lack of an extra space would be no big deal: > > [contact] > address: 742 Evergreen Terrace > : Springfield > : USA > phone: +1 (503) 331-5956 > email: david@kineticode.com
The big deal is when there are several in a row and the column of colons takes over visually. I think the current arrangement is safer and more readable in the long run. Show quoted text
> Thanks! I look forward to the next release. Thanks for being so > responsive to my complaints. ;-)
They've improved the module, so I appreciate them. Damian
Subject: Re: [rt.cpan.org #17794] New Data Has Too Much Spacing
Date: Wed, 1 Mar 2006 18:00:37 -0800
To: bug-Config-Std [...] rt.cpan.org
From: David Wheeler <dwheeler [...] cpan.org>
On Mar 1, 2006, at 17:56, damian@conway.org via RT wrote: Show quoted text
> The big deal is when there are several in a row and the column of > colons takes > over visually. > > I think the current arrangement is safer and more readable in the > long run.
Okay. Works for me. Show quoted text
> They've improved the module, so I appreciate them.
Well then, you're welcome! Best, David
Subject: Re: [rt.cpan.org #17794] New Data Has Too Much Spacing
Date: Tue, 14 Mar 2006 17:02:04 -0800
To: bug-Config-Std [...] rt.cpan.org
From: David Wheeler <david [...] kineticode.com>
On Mar 1, 2006, at 16:15, David Wheeler wrote: Show quoted text
>> Try the attached beta. It adds a 'def_gap' option (described in >> the POD). >> It also changes the defaults slightly, to be "semi-cuddly". >> >> Hope this helps ;-)
> > Yes, I played with it, and it's a big improvement. Thanks!
It turns out that I'm running into some errors in my application's tests, though I'm not sure what they're due to, yet: Can't call method "ensure_gap" on an undefined value at /usr/local/ lib/perl5/site_perl/5.8.8/Config/Std.pm line 223. BEGIN failed--compilation aborted at t/config.t line 10. # Looks like you planned 17 tests but only ran 1. # Looks like your test died just after 1. I had a look at the code, but I couldn't figure out where the $block variable at line 223 was coming from. I put in a use strict and fixed a few other uninitialized variable problems, but still couldn't figure out where that variable is supposed to come from. I've attache my modified version with the use strict changes. Am I missing something? Best, David

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #17794] New Data Has Too Much Spacing
Date: Tue, 14 Mar 2006 17:04:49 -0800
To: bug-Config-Std [...] rt.cpan.org
From: David Wheeler <dwheeler [...] cpan.org>
On Mar 14, 2006, at 17:03, David Wheeler via RT wrote: Show quoted text
> It turns out that I'm running into some errors in my application's > tests, though I'm not sure what they're due to, yet:
Reverting to 0.0.4 fixes my test failures, so it's something that changed between 0.0.4 and the version that you sent to me. Thanks, David
RT-Send-CC: david [...] kineticode.com
Damian fixed some problems in gap logic in 0.0.7. Are you good now? You may need to use before strict or in no strict. (I am trying weed the RT queue of things apparently fixed in 004..007 before attacking what's left.) -- bill for Boston.pm, new co*maintainer On Tue Mar 14 20:05:21 2006, DWHEELER wrote: Show quoted text
> On Mar 14, 2006, at 17:03, David Wheeler via RT wrote: >
> > It turns out that I'm running into some errors in my application's > > tests, though I'm not sure what they're due to, yet:
> > Reverting to 0.0.4 fixes my test failures, so it's something that > changed between 0.0.4 and the version that you sent to me. > > Thanks, > > David
Subject: Re: [rt.cpan.org #17794] New Data Has Too Much Spacing
Date: Mon, 8 Mar 2010 20:43:27 -0800
To: bug-Config-Std [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
On Mar 8, 2010, at 7:59 PM, William D (Bill) Ricker via RT wrote: Show quoted text
> Damian fixed some problems in gap logic in 0.0.7. Are you good now? > You may need to use before strict or in no strict. > > (I am trying weed the RT queue of things apparently fixed in 004..007 > before attacking what's left.)
No idea. I clearly haven't hacked on that app since 2006 or I would have complained more since then. :-) I don't even remember what the app was anymore. Best, David
Per prior interaction 0.007 fix may be adequate.