Files
news.gitea.happylizard.me/bin/gems/faraday-2.9.0/lib/faraday/middleware.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

34 lines
727 B
Ruby

# frozen_string_literal: true
module Faraday
# Middleware is the basic base class of any Faraday middleware.
class Middleware
extend MiddlewareRegistry
attr_reader :app, :options
def initialize(app = nil, options = {})
@app = app
@options = options
end
def call(env)
on_request(env) if respond_to?(:on_request)
app.call(env).on_complete do |environment|
on_complete(environment) if respond_to?(:on_complete)
end
rescue StandardError => e
on_error(e) if respond_to?(:on_error)
raise
end
def close
if app.respond_to?(:close)
app.close
else
warn "#{app} does not implement \#close!"
end
end
end
end