Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FREQ: Indentation on #write #9

Open
RoUS opened this issue Jul 5, 2012 · 2 comments
Open

FREQ: Indentation on #write #9

RoUS opened this issue Jul 5, 2012 · 2 comments

Comments

@RoUS
Copy link

RoUS commented Jul 5, 2012

I'd like to see a way to configure the indentation amount per [nested] group. E.g., set it to 4 and #write might emit

global_param = 1
[main]
main_param = 2
[sub1]
main_sub1_param = 3

Rather than adding all the code/logic to the gem for this, perhaps changing #write to take an optional block and pass some context info so the app can intervene as desired.

@derks
Copy link
Member

derks commented Jul 5, 2012

I apologize, but I'm not exactly clear on what you're asking for. There is no 'indentation' in the example above. Perhaps if you put the code within a <pre>...</pre> bock it would be more clear. For example, this is what I assume you mean:

global_param = 1

[main]
main_param = 2

    [sub1]
    main_sub1_param = 3

Currently ParseConfig doesn't read the config in this manner... but rather:

param = 1

[main]
main_param = 2

[sub1]
sub1_param = 3

@RoUS
Copy link
Author

RoUS commented Jul 5, 2012

On 07/05/2012 02:31 PM, BJ Dierkes wrote:

Currently ParseConfig doesn't read the config in this manner... but
rather:

Ah, groups cannot be nested. I wonder where I got that
impression from?

In that case, 'never mind.' But allowing block handling (such
as 'config.write do |group,param,val| / end') would be

quite cool.

#ken B-)}

Ken Coar, Sanagendamgagwedweinini
IT Engineering Tower, Red Hat/RDU

"Millennium hand and shrimp!"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants