Sha256: 8897a1362bf8eb46dd6262d2d097d00641b49da3b2965f86f74854d719c9fcfa
Contents?: true
Size: 1002 Bytes
Versions: 24
Compression:
Stored size: 1002 Bytes
Contents
/* Copyright (c) 2022 Contrast Security, Inc. See * https://www.contrastsecurity.com/enduser-terms-0317a for more details. */ #include "cs__assess_yield_track.h" #include "../cs__common/cs__common.h" #include <ruby.h> static VALUE rb_yield_hook(VALUE val, const VALUE self) { VALUE method = rb_funcall(rb_mKernel, rb_sym_method, 0); if (method == split_method && RB_TYPE_P(val, T_STRING)) { rb_funcall(split_class, propagate_yield, 1, val); } VALUE result = rb_yield_original(val); return result; } static int install_yield_hooks() { rb_yield_original = rb_yield; patch_via_funchook(&rb_yield_original, &rb_yield_hook); return 0; } void Init_cs__assess_yield_track(void) { VALUE base = rb_define_class_under(assess_propagator, "Base", rb_cObject); split_class = rb_define_class_under(assess_propagator, "Split", base); propagate_yield = rb_intern("propagate_yield"); split_method = ID2SYM(rb_intern("split")); install_yield_hooks(); }
Version data entries
24 entries across 24 versions & 1 rubygems