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,44 @@
class Binding
# Allows the evaluation of blocks by a Binding in the same way that strings
# can be evaluated.
#
# x = 5
# $my_binding = binding
#
# class Test # just here to provide a scope gate
# $my_binding.block_exec { x }
# end
#
# # => 5
#
# NOTE: The implementation of this method uses a method_missing trick.
# Consequently it is a bit of a hack.
#
def block_exec(*args, &block)
BlockEnvironment.new(self, *args, &block).call
end
# This class is used for evaluating blocks in a particular context.
# It is not really meant to be used independently; instead it is used
# with Binding#block_exec method.
class BlockEnvironment < BasicObject
def initialize(context, *args, &block)
@context = context
@args = args
@block = block
end
def call
instance_exec(*@args, &@block)
end
def method_missing(name)
eval(name.to_s, @context) rescue super
end
end
end