Closed bogdanRada closed 8 years ago
This idea seems sensible. It would have to be backward compatible though, and docs and tests should be updated too. I think this change would fully deserve a new minor version: 0.6.0 :)
i can work on tests, but it seems rack-test is not compatible with ruby > 2.1.5 . Would you mind if i rewrite tests to use rspec instead? or maybe minitest? which seems to be compatible .
You can see this issue here: https://travis-ci.org/bogdanRada/rack-proxy
I'm running Ruby 2.3.0 and the tests run fine (except one is failing, but this is not related):
/dev/rack-proxy (master)$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
~/dev/rack-proxy (master)$ rake test
/Users/ncr/.rubies/ruby-2.3.0/bin/ruby -I"lib:test" -I"/Users/ncr/.gem/ruby/2.3.0/gems/rake-10.5.0/lib" "/Users/ncr/.gem/ruby/2.3.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb" "test/http_streaming_response_test.rb" "test/net_http_hacked_test.rb" "test/rack_proxy_test.rb"
Loaded suite /Users/ncr/.gem/ruby/2.3.0/gems/rake-10.5.0/lib/rake/rake_test_loader
Started
_........._F
Failure:
Google always sets a cookie, yo. Where my cookies at?!.
I am really nto sure how you're doing that. I get this error: cannot load such file -- test/unit (LoadError) . Do you have something locally installed?
I was able to fix it by adding to gemspec this line:
s.add_development_dependency("test-unit")
I think this should be included in the gem , otherwise people would have hard time running tests Now the build is passing: https://travis-ci.org/bogdanRada/rack-proxy .
I commited the changes in this pull request for that. Hope that is fine.
The tests for this branch are passing https://travis-ci.org/bogdanRada/rack-proxy/builds/131397008 . So i don;t think we need to update tests.
Looks ok.
czw., 19.05.2016 o 14:03 użytkownik rada bogdan raul < notifications@github.com> napisał:
I was able to fix it by adding to gemspec this line:
s.add_development_dependency("test-unit")
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/ncr/rack-proxy/pull/55#issuecomment-220304371
updated the readme too. I think now the only change is to bump the version, but that i think should be done after merging the pull request by the owner or one of the collaborators. Let me know if it looks ok, Thank you very much
updated the code, Build is passing: https://travis-ci.org/bogdanRada/rack-proxy/builds/131414275
Build is still passing https://travis-ci.org/bogdanRada/rack-proxy/builds/131415945
Applied suggestion for conditional . Build is passing :https://travis-ci.org/bogdanRada/rack-proxy/builds/131432384
Thanks a lot! Will release a new gem shortly.
Awesome . thanks
In order for Rack Proxy to work as middleware for a Rack application (Rails or sinatra or any rack based application ) the initialize method for the Rack::Proxy class needed to be changed to receive first the application and then the options.
why is it useful? Consider folowing scenario: Having a application that uses by default Savon for doing request to a web-service, but want to proxy only some requests to another server. could be easily achieved doing this:
This means in Rails you could use this like this:
and in sintra you could do like this:
instead of doing
In this example only requests that end with ".php" are proxied , the other requests are not proxied.
This might be a backward incompatible change and the README might need updated too. I am opened though to suggestions.
This fixes also #53
Let me know what you think. Thank you very much