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