kachick / proc-isolation

Expose hidden feature around `Proc#isolate` in CRuby

Home Page:https://kachick.github.io/proc-isolation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

  • 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

About

Expose hidden feature around `Proc#isolate` in CRuby

https://kachick.github.io/proc-isolation/

License:MIT License


Languages

Language:Ruby 95.6%Language:C 3.4%Language:Shell 1.0%