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

Allow multiple configurations of Nori #9

Merged

Conversation

hsume2
Copy link

@hsume2 hsume2 commented Jan 17, 2012

Hi,

The way that nori config is global had some adverse effects on my project. We use nori in our test-suite to parse XML to Hash, but once we included the savon gem it started to break a bunch of our code due to the following snippet:

Nori.configure do |config|
  config.strip_namespaces = true
  config.convert_tags_to { |tag| tag.snakecase.to_sym }
end

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:

module TestNori
  extend Nori
end

Calls to TestNori.configure would then be isolated from Nori.configure. This seemed a much quicker solution, and may be of use to others who plan to use nori 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

@pkoch
Copy link

pkoch commented Jan 31, 2012

+1

@rubiii rubiii merged commit 1ba139d into savonrb:master Feb 17, 2012
@rubiii
Copy link
Contributor

rubiii commented Feb 17, 2012

nce solution. thanks henry!

@rubiii
Copy link
Contributor

rubiii commented Feb 17, 2012

released v1.1.0

@hsume2
Copy link
Author

hsume2 commented Feb 17, 2012

thanks! I look forward to bragging about this at my company :)

@rubiii
Copy link
Contributor

rubiii commented Feb 17, 2012

he, he ... enjoy it :)

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

Successfully merging this pull request may close these issues.

3 participants