Skip to content

Commit

Permalink
removes unused Faraday opts, adds aliases sdb, fdb, fdb_json
Browse files Browse the repository at this point in the history
  • Loading branch information
jontsai committed Mar 19, 2024
1 parent 0c73838 commit 3f860ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 1 addition & 6 deletions lib/Htk/apis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib/Htk/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def slack_debug(text)
'text' => text,
}.to_json
end
response.status
end

##
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3f860ca

Please sign in to comment.