Add bin and edit workflow
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s

This commit is contained in:
2026-09-16 13:11:16 -06:00
parent c8ac4fcae5
commit 4cee170d66
17576 changed files with 895740 additions and 2 deletions
@@ -0,0 +1,64 @@
# frozen_string_literal: true
module Ethon
class Easy
# This module contains the logic to prepare and perform
# an easy.
module Operations
# Returns a pointer to the curl easy handle.
#
# @example Return the handle.
# easy.handle
#
# @return [ FFI::Pointer ] A pointer to the curl easy handle.
def handle
@handle ||= FFI::AutoPointer.new(Curl.easy_init, Curl.method(:easy_cleanup))
end
# Sets a pointer to the curl easy handle.
# @param [ ::FFI::Pointer ] Easy handle that will be assigned.
def handle=(h)
@handle = h
end
# Perform the easy request.
#
# @example Perform the request.
# easy.perform
#
# @return [ Integer ] The return code.
def perform
@return_code = Curl.easy_perform(handle)
if Ethon.logger.debug?
Ethon.logger.debug { "ETHON: performed #{log_inspect}" }
end
complete
@return_code
end
# Clean up the easy.
#
# @example Perform clean up.
# easy.cleanup
#
# @return the result of the free which is nil
def cleanup
handle.free
end
# Prepare the easy. Options, headers and callbacks
# were set.
#
# @example Prepare easy.
# easy.prepare
#
# @deprecated It is no longer necessary to call prepare.
def prepare
Ethon.logger.warn(
"ETHON: It is no longer necessary to call "+
"Easy#prepare. It's going to be removed "+
"in future versions."
)
end
end
end
end