-
This repository has been archived.
-
No longer maintained.
-
All versions have been removed from https://rubygems.org to free up valuable namespace for other developers.
proc-isolation
An evil tool, this gem expose hidden feature around Proc#isolate in CRuby. \ Do not use in your production code, stop to use just only fun in your sandbox. :)
Usage
Require Ruby 3.0 or later
Overview
require 'proc/isolation'
prc = ->{ 42 }
prc.isolate #=> New isolated Proc instance will be returned
prc.isolate! #=> The Proc instance will be isolated
local_variable = 42
-> { local_variable }.isolate #=> can not isolate a Proc because it accesses outer variables (local_variable). (ArgumentError)