0.0
The project is in a healthy, maintained state
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. :)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies
 Project Readme

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 Gem Version

Usage

Require Ruby 3.0 or later

Add below code into your Gemfile

gem 'proc-isolation'

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