mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00

`self` is nearest Ruby method's `self`. If there is no ruby frame, use toplevel `self` (`main`). https://bugs.ruby-lang.org/issues/18780
13 lines
216 B
C
13 lines
216 B
C
#include "ruby/ruby.h"
|
|
|
|
static VALUE
|
|
eval_string(VALUE self, VALUE str)
|
|
{
|
|
return rb_eval_string(StringValueCStr(str));
|
|
}
|
|
|
|
void
|
|
Init_eval(void)
|
|
{
|
|
rb_define_global_function("rb_eval_string", eval_string, 1);
|
|
}
|