From 5957789524dccdf051bf91a1390dfd28578f44af Mon Sep 17 00:00:00 2001 From: hermeswaldemarin Date: Thu, 25 May 2023 17:32:09 +0100 Subject: [PATCH 1/2] Upgrading Faraday --- Gemfile.lock | 33 ++++++++------------------------- absmartly.gemspec | 3 ++- example/example.rb | 6 +++--- lib/absmartly/version.rb | 2 +- lib/default_http_client.rb | 1 + 5 files changed, 15 insertions(+), 30 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 28bb06a..4096ba3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,10 @@ PATH remote: . specs: - absmartly-sdk (1.0.7) + absmartly-sdk (1.0.8) arraybuffer (~> 0.0.6) - faraday (~> 1.10.3) + faraday (~> 2.0) + faraday-retry (~> 2.0) murmurhash3 (~> 0.1.7) GEM @@ -13,34 +14,16 @@ GEM ast (2.4.2) byebug (11.1.3) diff-lcs (1.5.0) - faraday (1.10.3) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) + faraday (2.7.4) + faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) + faraday-net_http (3.0.2) + faraday-retry (2.1.0) + faraday (~> 2.0) io-console (0.5.6) irb (1.2.6) reline (>= 0.1.5) json (2.6.2) - multipart-post (2.1.1) murmurhash3 (0.1.7) parallel (1.22.1) parser (3.1.2.0) diff --git a/absmartly.gemspec b/absmartly.gemspec index 727efbf..780c473 100644 --- a/absmartly.gemspec +++ b/absmartly.gemspec @@ -32,7 +32,8 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "faraday", "~> 1.10.3" + spec.add_dependency "faraday", "~> 2.0" + spec.add_dependency "faraday-retry", "~> 2.0" spec.add_dependency "murmurhash3", "~> 0.1.7" spec.add_dependency "arraybuffer", "~> 0.0.6" diff --git a/example/example.rb b/example/example.rb index 5fd6f18..9ca10fa 100644 --- a/example/example.rb +++ b/example/example.rb @@ -12,7 +12,7 @@ # define a new context request context_config = Absmartly.create_context_config -context_config.set_unit("session_id", "bf06d8cb5d8137290c4abb64155584fbdb64d8") +#context_config.set_unit("session_id", "bf06d8cb5d8137290c4abb64155584fbdb64d8") context_config.set_unit("user_id", "123456") ctx = Absmartly.create_context(context_config) @@ -26,8 +26,8 @@ treatment3 = ctx.treatment("test") puts(treatment3) # 1 -ctx.set_unit("db_user_id", 1000013) -ctx.set_units(db_user_id2: 1000013, session_id2: 12311) +#ctx.set_unit("db_user_id", 1000013) +#ctx.set_units(db_user_id2: 1000013, session_id2: 12311) ctx.set_attribute("user_agent", "Chrome 2022") ctx.set_attributes( diff --git a/lib/absmartly/version.rb b/lib/absmartly/version.rb index 130661d..8d957ef 100644 --- a/lib/absmartly/version.rb +++ b/lib/absmartly/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Absmartly - VERSION = "1.0.7" + VERSION = "1.0.8" end diff --git a/lib/default_http_client.rb b/lib/default_http_client.rb index 1d9fede..eea0895 100644 --- a/lib/default_http_client.rb +++ b/lib/default_http_client.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require "faraday" +require 'faraday/retry' require "uri" require_relative "http_client" From a66f7678948d52ad0b2e3eaf18c6e124ab9eea5c Mon Sep 17 00:00:00 2001 From: hermeswaldemarin Date: Thu, 25 May 2023 17:34:47 +0100 Subject: [PATCH 2/2] Upgrading Faraday --- example/example.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/example.rb b/example/example.rb index 9ca10fa..5fd6f18 100644 --- a/example/example.rb +++ b/example/example.rb @@ -12,7 +12,7 @@ # define a new context request context_config = Absmartly.create_context_config -#context_config.set_unit("session_id", "bf06d8cb5d8137290c4abb64155584fbdb64d8") +context_config.set_unit("session_id", "bf06d8cb5d8137290c4abb64155584fbdb64d8") context_config.set_unit("user_id", "123456") ctx = Absmartly.create_context(context_config) @@ -26,8 +26,8 @@ treatment3 = ctx.treatment("test") puts(treatment3) # 1 -#ctx.set_unit("db_user_id", 1000013) -#ctx.set_units(db_user_id2: 1000013, session_id2: 12311) +ctx.set_unit("db_user_id", 1000013) +ctx.set_units(db_user_id2: 1000013, session_id2: 12311) ctx.set_attribute("user_agent", "Chrome 2022") ctx.set_attributes(