Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add #cert and #key aliases #26

Merged
merged 1 commit into from

2 participants

@dlee

Users familiar with Net::HTTP can use #cert and #key methods instead of #certificate and #private_key.

This also allows easier swapping in of Net::HTTP::Persistant for code that's already using Net::HTTP.

@dlee dlee Add #cert and #key aliases
for users familiar with Net::HTTP
3a4f3cd
@drbrain drbrain merged commit c8ad9da into drbrain:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 18, 2012
  1. @dlee

    Add #cert and #key aliases

    dlee authored
    for users familiar with Net::HTTP
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/net/http/persistent.rb
View
12 lib/net/http/persistent.rb
@@ -190,6 +190,9 @@ class Error < StandardError; end
attr_reader :certificate
+ # For Net::HTTP parity
+ alias cert certificate
+
##
# An SSL certificate authority. Setting this will set verify_mode to
# VERIFY_PEER.
@@ -269,6 +272,9 @@ class Error < StandardError; end
attr_reader :private_key
+ # For Net::HTTP parity
+ alias key private_key
+
##
# The URL through which requests will be proxied
@@ -420,6 +426,9 @@ def certificate= certificate
reconnect_ssl
end
+ # For Net::HTTP parity
+ alias cert= certificate=
+
##
# Sets the SSL certificate authority file.
@@ -680,6 +689,9 @@ def private_key= key
reconnect_ssl
end
+ # For Net::HTTP parity
+ alias key= private_key=
+
##
# Sets the proxy server. The +proxy+ may be the URI of the proxy server,
# the symbol +:ENV+ which will read the proxy from the environment or nil to
Something went wrong with that request. Please try again.