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

qualify use of Net::Foo modules in response.rb so namespace doesn't conflict #63

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

cap10morgan commented Jan 19, 2011

I'm getting "uninitialized constant HTTParty::Response::Net" errors with the existing code, but qualifying the references to Net::___ modules with a leading double-colon (like ::Net::___) in response.rb fixes the problem.

Collaborator

sandro commented Jan 19, 2011

Sounds good, I'll pull it in. What version of Ruby are you running?

Contributor

cap10morgan commented Jan 19, 2011

I'm using MRI 1.9.2-p136 w/ latest RVM on OS X.

sandro commented on 890b126 Jan 19, 2011

Think that line 62 would still work? Did you run the tests?

Not sure. It seems like it should work for the specific changes above. But if there are other elements in that array that are formatted the old way, it should probably a regexp in that sub call. Something like:
name = klass.name.sub(/^(?:::)?Net::HTTP/, '')

I couldn't get the test suite to run under 1.9.2. Seems there is a lot of breakage under that Ruby version. That should probably discourage me from using it in 1.9.2...

OK, I ran the tests under 1.8.7. Seems that change broke some things. I'll try it with the regexp instead.

Regexp seems overkill, the question is this: ::Object.name == Object.name. The answer is that line 62 doesn't need to change.

Contributor

cap10morgan commented Jan 19, 2011

OK, that last commit made the tests pass under 1.8.7.

Contributor

cap10morgan commented Jan 19, 2011

OK, yeah, that's better. I'm trying to fix the test suite under 1.9.2 now.

Collaborator

sandro commented Jan 19, 2011

Ruby 1.9.2 fixes

Closed by a51ce57
Closed by a51ce57

ntalbott pushed a commit to ntalbott/httparty that referenced this pull request May 4, 2012

This issue was closed.

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