- 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.
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. :)
Require Ruby 3.0 or later
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)