From 3f860ca4bfecac1e3a819fb93ca67cafd2d01c3f Mon Sep 17 00:00:00 2001 From: Jonathan Tsai Date: Tue, 19 Mar 2024 15:01:01 -0700 Subject: [PATCH] removes unused Faraday opts, adds aliases sdb, fdb, fdb_json --- lib/Htk/apis.rb | 7 +------ lib/Htk/utils.rb | 5 +++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Htk/apis.rb b/lib/Htk/apis.rb index 3db417a..13992c4 100644 --- a/lib/Htk/apis.rb +++ b/lib/Htk/apis.rb @@ -12,14 +12,9 @@ def initialize(name, url) def connection(&block) Faraday.new(url) do |faraday| - faraday.use ::Middleware::Mode - faraday.use ::Middleware::AuthParams - faraday.use ::Middleware::UseCanary - faraday.use ::Middleware::Timeout - faraday.use ::Middleware::RequestUuid faraday.use ::Faraday::Request::Multipart faraday.use ::Faraday::Request::UrlEncoded - faraday.use ::Faraday::Adapter::NetHttp + faraday.adapter ::Faraday::Adapter::NetHttp block.call(faraday) if block_given? end diff --git a/lib/Htk/utils.rb b/lib/Htk/utils.rb index 5999e9a..a3520e5 100644 --- a/lib/Htk/utils.rb +++ b/lib/Htk/utils.rb @@ -33,6 +33,7 @@ def slack_debug(text) 'text' => text, }.to_json end + response.status end ## @@ -65,6 +66,10 @@ def fdebug_json(obj, file_path=DEFAULT_FILE_PATH) data = obj.to_json fdebug(JSON.pretty_generate(data), file_path) end + + alias_method :sdb, :slack_debug + alias_method :fdb, :fdebug + alias_method :fdb_json, :fdebug_json end Utils = Base.new