From feda5851e995ebce3bf983d844b324aa469869b5 Mon Sep 17 00:00:00 2001 From: myk002 Date: Sun, 31 Jul 2022 13:28:01 -0700 Subject: [PATCH] add example for ruby plugin --- docs/plugins/ruby.rst | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/plugins/ruby.rst b/docs/plugins/ruby.rst index bdd5521a4..beb9be4a1 100644 --- a/docs/plugins/ruby.rst +++ b/docs/plugins/ruby.rst @@ -2,5 +2,22 @@ ruby ==== -Ruby language plugin, which evaluates the following arguments as a ruby string. -Best used as ``:rb [string]``, for the special parsing mode. Alias ``rb_eval``. +Tags: +:dfhack-keybind:`rb` +:dfhack-keybind:`rb_eval` + +Allow Ruby scripts to be executed. When invoked as a command, you can Eval() a +ruby string. + +Usage:: + + enable ruby + rb "ruby expression" + rb_eval "ruby expression" + :rb ruby expression + +Example +------- + +``:rb puts df.unit_find(:selected).name`` + Print the name of the selected unit.