Closed jennifersmith closed 9 years ago
Good question, why I implemented it this way. :smile: But I think your implementation was the one I had in mind.
The only thing I would change is the style of the each-loop.
env.each { |k,v| set_env k, v }
@jarl-dk Should he provide a PR?
@jarl-dk Should he provide a PR?
@jarl-dk Should she provide a PR? Sorry for that @jennifersmith
Thanks for this.
Ha no worries on both counts, thanks for addressing this (and for a very useful library) On 15 Jan 2015 00:37, "Jarl Friis" notifications@github.com wrote:
Thanks for this.
— Reply to this email directly or view it on GitHub https://github.com/cucumber/aruba/issues/223#issuecomment-69916469.
I see that recently @dg-ratiodata added a helpful method
with_env
to Aruba::API (#188) that allows you to run a block with environment variables set which are then restored back to original values.However, the current implementation seems to run the block once for each env var you pass into the hash.
Is this the intended behaviour?
Context: I want to set a series of env vars before running my process all together,
I can achieve this by calling the underlying methods directly, but I wondered whether you would be happy for me to change this method to set all the vars just once and then call the block. Something like:
Appreciate that this breaks existing behaviour and so might be a breaking change for some people - so I would be happy to rename this method or use an alternative approach.