-
Notifications
You must be signed in to change notification settings - Fork 616
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
Interface for savon-multipart for Savon2 #434
Conversation
The motivation behind this change is to provide the savon-multipart gem a hook so that one can use it with savon. There is little desire (or much reason) to fix this directly in Savon since very few people will ever use it. So long as there is a mechanism for end users of savon-multipart to specify this, it should be easy for Savon to refactor without needing to make changes for multipart support. The indended use case for this would be to either configure a global or local multipart key to :true like so: client = Savon::Client('http://service.example.com', :multipart => true) # or for only a single call on a client client.call(:some_method_returns_multipart, :multipart => true)
I had forgot that class_variable_set was a private method before ruby 1.9
hey @tjarratt, thanks for taking the time to work on this! your change looks good. i would probably change ps. did you remove your fork of savon-multipart from github? |
thanks. i was looking for the changes to savon-multipart (which moved here). |
regarding the changes to savon, i think i would rather raise an error in case multipart was enabled and savon-multipart could not be loaded instead of storing the result in the |
Yeah, that sounds eminently reasonable. |
Don't try to load it, assume that the end user will do this - this way we don't need to potentially call require multiple times during runtime. Also fixed the multipart specs so they'd be less likely to interfere with other ones and make those fail. Instead of mucking with the spec-level globals object, create one for multipart when we need it.
thanks! let me know when this works with the new savon-multipart. |
This all works with the new savon-multipart. I've been waiting to issue a pull request for savon-multiplart until this makes it in. |
@tjarratt could you open the pull request and link it to this issue so i can take another look at the changes and easily test both in integration? |
Interface for savon-multipart for Savon2
After much deliberation in the comments for issue 424 I am proud to present some support in Savon 2 for the multipart-savon gem.
The motivation behind this change is to provide the savon-multipart gem a hook
so that one can use it with savon. There is little desire (or much reason) to
fix this directly in Savon since very few people will ever use it. So long as
there is a mechanism for end users of savon-multipart to specify this, it should
be easy for Savon to refactor without needing to make changes for multipart
support.
The indended use case for this would be to either configure a global or local
multipart key to :true like so:
The tests here only test that we return an object that is an instance of a Savon::Multipart::Response, but does not assert on the functionality of that class. I currently have a fork of savon-multipart with those changes that might be interesting to view alongside these.
Any feedback is greatly appreciated! Many thanks for @rubiii for taking the time to read my incoherent ramblings and help design a good interface. My own regret is that it took me so long to formalize this!