diff options
author | Azul <azul@riseup.net> | 2017-09-23 11:07:32 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2017-09-23 16:53:27 +0200 |
commit | 40916407517f4bdb75a295caf29e02d4f403349b (patch) | |
tree | 8219567c0ecdf583fdd916594ec7915ab9eb2f19 /lib/nickserver/adapters | |
parent | 22c6c80310a8d3d3abbd1006598b4fbaec98ffd0 (diff) |
style: rubocop mostly auto-correct
Diffstat (limited to 'lib/nickserver/adapters')
-rw-r--r-- | lib/nickserver/adapters/celluloid_http.rb | 2 | ||||
-rw-r--r-- | lib/nickserver/adapters/http.rb | 26 |
2 files changed, 13 insertions, 15 deletions
diff --git a/lib/nickserver/adapters/celluloid_http.rb b/lib/nickserver/adapters/celluloid_http.rb index 62f905f..cdcc493 100644 --- a/lib/nickserver/adapters/celluloid_http.rb +++ b/lib/nickserver/adapters/celluloid_http.rb @@ -4,6 +4,7 @@ silence_warnings do end module Nickserver::Adapters + # HTTP Adapter using Celluloid::IO class CelluloidHttp < Http silence_warnings do include Celluloid::IO @@ -14,6 +15,5 @@ module Nickserver::Adapters def default_options super.merge ssl_socket_class: Celluloid::IO::SSLSocket end - end end diff --git a/lib/nickserver/adapters/http.rb b/lib/nickserver/adapters/http.rb index eb77cc6..a759e53 100644 --- a/lib/nickserver/adapters/http.rb +++ b/lib/nickserver/adapters/http.rb @@ -2,22 +2,20 @@ require 'nickserver/adapters' require 'nickserver/config' require 'http' -# Nickserver::Adapters::Http -# -# Basic http adapter with ssl and minimal error handling. -# Only implemented get requests so far. -# -# Error Handling: -# -# Pass a string as the 'rescue' option. If a ConnectionError occures -# which includes the string passed it will be rescued and the request -# will return nil. This allows handling the error inside the adapter so -# that for the derived CelluloidHttp Adapter the actor does not get -# killed. - module Nickserver::Adapters + # Nickserver::Adapters::Http + # + # Basic http adapter with ssl and minimal error handling. + # Only implemented get requests so far. + # + # Error Handling: + # + # Pass a string as the 'rescue' option. If a ConnectionError occures + # which includes the string passed it will be rescued and the request + # will return nil. This allows handling the error inside the adapter so + # that for the derived CelluloidHttp Adapter the actor does not get + # killed. class Http - def get(url, options = {}) url = HTTP::URI.parse url.to_s response = get_with_auth url, params: options[:query] |