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

Already on GitHub? Sign in to your account

From 618816f, implement interpolation of %([BLOCK.]KEY) #2

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

pivaldi commented Jul 24, 2011

On my branch "optimized"…
I've reverted to commit 618816f because the commit bcb7c67 disallows an optimized implementation of interpolation of %(block.key), see comment on the commit bcb7c67.
I've implemented the extension of %(block.key) like the Python ConfigParser does but %(REF) can refer to an other block and can be recursive.

Owner

Ajnasz commented Jul 24, 2011

Check out my interpolation branch 9c7e9b6

How differs the getParam from yours:
First I'm working with the params like when the inheritDefault is false. Then if it's true and the values has the DEFAULT section, I update the values. The updating is moved out into a separate method, so it's easier to read to me.

Contributor

pivaldi commented Jul 24, 2011

It looks perfect !

Contributor

pivaldi commented Jul 24, 2011

In fact, in your branch interpolation, parser.interpolate() does not extend the %(*)

Owner

Ajnasz commented Jul 25, 2011

I copied your interpolate method or maybe I missed something?

Contributor

pivaldi commented Jul 25, 2011

Hi,
I think that all is right with the commit 808b247 in my branch "interpolation".

Owner

Ajnasz commented Jul 27, 2011

That looks good.
I thought of something. It would look better if we would use the Object.keys to walk through on the object keys instead of for .. in. Then we wouldn't need to use hasOwnProperty all the time, it would look better.

Contributor

pivaldi commented Jul 27, 2011

I'm not sure that was useful because the objects treated haven't prototype but it's done :)

Owner

Ajnasz commented Jul 28, 2011

Yeash, but I'm using jslint and it always mark it as a warning. :)
Thanks

Owner

Ajnasz commented Jul 28, 2011

merged

@Ajnasz Ajnasz closed this Jul 28, 2011

Owner

Ajnasz commented Jul 28, 2011

I also published to npm.

Can I ask one more thing? Could you describe this method in the readme file please?

Contributor

pivaldi commented Jul 28, 2011

Done in the branch "master"

Owner

Ajnasz commented Jul 30, 2011

Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment