add example for ruby plugin

develop
myk002 2022-07-31 13:28:01 -07:00
parent 8cc0cee9a8
commit feda5851e9
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 19 additions and 2 deletions

@ -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.