Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

kachick/proc-isolation

Repository files navigation

  • 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. :)


Build Status

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)

Links