From f33b84e0f02ac86cf77c6e67cb123af555f19d27 Mon Sep 17 00:00:00 2001 From: Guillermo Guerrero Date: Tue, 7 Apr 2020 15:29:48 +0200 Subject: [PATCH 1/3] Allow to send proxy params. --- lib/snitcher.rb | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/snitcher.rb b/lib/snitcher.rb index 9fd9536..3859271 100644 --- a/lib/snitcher.rb +++ b/lib/snitcher.rb @@ -44,7 +44,7 @@ def snitch!(token, opts = {}) opts = initialize_opts(opts, uri) - Net::HTTP.start(uri.host, uri.port, opts) do |http| + Net::HTTP.start(uri.host, uri.port, *opts) do |http| request = Net::HTTP::Get.new(uri.request_uri) request["User-Agent"] = user_agent @@ -86,12 +86,18 @@ def snitch(*args) def initialize_opts(options, uri) timeout = options.fetch(:timeout, 5) - { - open_timeout: timeout, - read_timeout: timeout, - ssl_timeout: timeout, - use_ssl: use_ssl?(uri), - } + [ + options.fetch(:p_addr, :ENV), + options.fetch(:p_port, nil), + options.fetch(:p_user, nil), + options.fetch(:p_pass, nil), + { + open_timeout: timeout, + read_timeout: timeout, + ssl_timeout: timeout, + use_ssl: use_ssl?(uri), + } + ] end def checkin_url(opts, token) From 145b69ffcae6cb9d36e4c138951f6ed180b20385 Mon Sep 17 00:00:00 2001 From: Guillermo Guerrero Date: Wed, 8 Apr 2020 09:50:13 +0200 Subject: [PATCH 2/3] Fixed travis, config overwritten --- .travis.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index d238f55..806e8ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,13 @@ dist: xenial language: ruby matrix: + include: + - rvm: 2.0.0-p648 + env: BUNDLER_VERSION="1.17.3" + - rvm: 2.1.10 + env: BUNDLER_VERSION="1.17.3" + - rvm: 2.2.10 + env: BUNDLER_VERSION="1.17.3" allow_failures: - rvm: ruby-head @@ -17,15 +24,6 @@ rvm: - jruby - ruby-head -matrix: - include: - - rvm: 2.0.0-p648 - env: BUNDLER_VERSION="1.17.3" - - rvm: 2.1.10 - env: BUNDLER_VERSION="1.17.3" - - rvm: 2.2.10 - env: BUNDLER_VERSION="1.17.3" - notifications: webhooks: urls: From 14f1b5eff02ab166ebb6e5e595940d171676fe7b Mon Sep 17 00:00:00 2001 From: Guillermo Guerrero Date: Thu, 30 Apr 2020 08:29:55 +0200 Subject: [PATCH 3/3] added if with ruby version and default values. --- lib/snitcher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/snitcher.rb b/lib/snitcher.rb index 3859271..07272d0 100644 --- a/lib/snitcher.rb +++ b/lib/snitcher.rb @@ -87,7 +87,7 @@ def initialize_opts(options, uri) timeout = options.fetch(:timeout, 5) [ - options.fetch(:p_addr, :ENV), + options.fetch(:p_addr, RUBY_VERSION < '2.5' ? nil : :ENV), options.fetch(:p_port, nil), options.fetch(:p_user, nil), options.fetch(:p_pass, nil),