fix for issue 195 https://github.com/rubygems/rubygems/issues/195 (honor NO_PROXY env) #199

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
5 participants
@svoynow

svoynow commented Sep 27, 2011

I'm not entirely sure that I've gotten the hostname matching done exactly as everybody would want it, but it should work for most purposes.

@svoynow

This comment has been minimized.

Show comment
Hide comment
@svoynow

svoynow Sep 29, 2011

A little more explanation to hopefully increase the chances of this being pulled.
The gem command reference (http://docs.rubygems.org/read/chapter/13#page51) says:

Command-line applications typically set an environment variable to specify an HTTP proxy through which to access the Internet. gem respects the following variables:

http_proxy
HTTP_PROXY
NO_PROXY

I've added a couple of tests that fail involving setting NO_PROXY in the environment which fail with the current rubygems, but which pass with my changes.

svoynow commented Sep 29, 2011

A little more explanation to hopefully increase the chances of this being pulled.
The gem command reference (http://docs.rubygems.org/read/chapter/13#page51) says:

Command-line applications typically set an environment variable to specify an HTTP proxy through which to access the Internet. gem respects the following variables:

http_proxy
HTTP_PROXY
NO_PROXY

I've added a couple of tests that fail involving setting NO_PROXY in the environment which fail with the current rubygems, but which pass with my changes.

@ghost ghost assigned drbrain Sep 30, 2011

@darrin-wortlehock

This comment has been minimized.

Show comment
Hide comment
@darrin-wortlehock

darrin-wortlehock Feb 17, 2012

I can confirm that this patch solves the issue for me, specifically the situation where I want to use a local gem server behind a firewall (therefore requiring no_proxy) to install private gems which have dependencies on public gems hosted on rubygems.org

I can confirm that this patch solves the issue for me, specifically the situation where I want to use a local gem server behind a firewall (therefore requiring no_proxy) to install private gems which have dependencies on public gems hosted on rubygems.org

@databus23

This comment has been minimized.

Show comment
Hide comment

+1

@j3p0uk

This comment has been minimized.

Show comment
Hide comment
@j3p0uk

j3p0uk Apr 18, 2012

The following is needed to ensure the tests pass if a no_proxy environment variable is in existence outside of the test environment:

jonp@ubuntu-vmware:~/git/rubygems$ git diff
diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb
index 9222ba8..de472bb 100644
--- a/test/rubygems/test_gem_remote_fetcher.rb
+++ b/test/rubygems/test_gem_remote_fetcher.rb
@@ -85,6 +85,8 @@ gems:
ENV.delete 'HTTP_PROXY_USER'
ENV.delete 'http_proxy_pass'
ENV.delete 'HTTP_PROXY_PASS'

  • ENV.delete 'no_proxy'
  • ENV.delete 'NO_PROXY'

base_server_uri = "http://localhost:#{SERVER_PORT}"
@proxy_uri = "http://localhost:#{PROXY_PORT}"

j3p0uk commented on 7c3b86a Apr 18, 2012

The following is needed to ensure the tests pass if a no_proxy environment variable is in existence outside of the test environment:

jonp@ubuntu-vmware:~/git/rubygems$ git diff
diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb
index 9222ba8..de472bb 100644
--- a/test/rubygems/test_gem_remote_fetcher.rb
+++ b/test/rubygems/test_gem_remote_fetcher.rb
@@ -85,6 +85,8 @@ gems:
ENV.delete 'HTTP_PROXY_USER'
ENV.delete 'http_proxy_pass'
ENV.delete 'HTTP_PROXY_PASS'

  • ENV.delete 'no_proxy'
  • ENV.delete 'NO_PROXY'

base_server_uri = "http://localhost:#{SERVER_PORT}"
@proxy_uri = "http://localhost:#{PROXY_PORT}"

This comment has been minimized.

Show comment
Hide comment
@svoynow

svoynow Apr 18, 2012

Owner

Good catch. I've checked this in.
68f1109

Owner

svoynow replied Apr 18, 2012

Good catch. I've checked this in.
68f1109

drbrain added a commit that referenced this pull request Nov 27, 2012

Use http_proxy to avoid warnings.
Stop restoring already empty http proxy ENV variables

Finished #199
@drbrain

This comment has been minimized.

Show comment
Hide comment
@drbrain

drbrain Nov 27, 2012

Member

Committed, thanks!

Member

drbrain commented Nov 27, 2012

Committed, thanks!

@drbrain drbrain closed this Nov 27, 2012

nobu pushed a commit to nobu/rubygems that referenced this pull request Jan 12, 2014

Merge pull request #199 from kachick/spec-comparable-equal_value
Fix and refactoring specs for Comparable#==
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment