Allow multiple configurations of Nori #9
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
The way that
nori
config is global had some adverse effects on my project. We usenori
in our test-suite to parse XML to Hash, but once we included thesavon
gem it started to break a bunch of our code due to the following snippet:We strictly use camel-case tags because of external API dependencies, and this was causing our tests to fail. We opted out of changing our usage to snake-case (even though we should), because then we weren't mirroring our external API dependencies. Instead, we decided to allow multiple configurations of
nori
, like:Calls to
TestNori.configure
would then be isolated fromNori.configure
. This seemed a much quicker solution, and may be of use to others who plan to usenori
in various contexts. Feel free to let me know what you think, I'd be happy to make any changes to help this get into the mainline gem.CI: http://travis-ci.org/#!/hsume2/nori