Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Picky style tweaks

  • Loading branch information...
commit b61e8917e49d04320deb3ab76a1169d49d2d3de2 1 parent 7b7ec0a
@ConradIrwin authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 lib/jist.rb
View
16 lib/jist.rb
@@ -151,15 +151,15 @@ def login!
# Return HTTP connection
#
# @return [Net::HTTP]
- def http_connection()
+ def http_connection
env = ENV['http_proxy'] || ENV['HTTP_PROXY']
- if env then
- uri = URI(env)
- proxy_host, proxy_port = uri.host, uri.port
- else
- proxy_host, proxy_port = nil, nil
- end
- connection = Net::HTTP::Proxy(proxy_host, proxy_port).new("api.github.com", 443)
+ connection = if env
+ uri = URI(env)
+ proxy_host, proxy_port = uri.host, uri.port
+ Net::HTTP::Proxy(proxy_host, proxy_port).new("api.github.com", 443)
+ else
+ Net::HTTP.new("api.github.com", 443)
+ end
connection.use_ssl = true
connection.verify_mode = OpenSSL::SSL::VERIFY_NONE
connection.open_timeout = 10
Please sign in to comment.
Something went wrong with that request. Please try again.