ruru icon indicating copy to clipboard operation
ruru copied to clipboard

Protect send: a panic safe feature for Ruby interaction

Open danielpclark opened this issue 7 years ago • 2 comments

This is forked off of the eval PR. After ruby-sys is updated I'll fix the Cargo.toml file.

Provides

  • Object#protect_send -> Result<AnyObject, AnyObject>
  • Object#protect_public_send -> Result<AnyObject, AnyObject>

Methods can be called with these just like with send except instead of crashing when Ruby raises/throws an exception we can now handle the exception on the Err path.

TODO

  • [ ] Wait for ruby-sys update and update Cargo.toml

danielpclark avatar Feb 19 '18 10:02 danielpclark

@danielpclark Exciting! Do you need a help with this? Are we still waiting for ruby-sys ?

Antti avatar Mar 06 '18 17:03 Antti

Thanks, I don't need help, and yes we're waiting for ruby-sys.

In the mean time I've got all my PRs here available to use from the playground branch of my fork https://github.com/danielpclark/ruru/tree/playground . Since some of my gem releases for FasterPath depend on it I won't be deleting that branch ever.

danielpclark avatar Mar 06 '18 17:03 danielpclark