dfhack/docs/plugins/ruby.rst

29 lines
466 B
ReStructuredText

.. _rb:
ruby
====
2022-07-31 14:28:01 -06:00
.. dfhack-tool::
:summary: Allow Ruby scripts to be executed as DFHack commands.
:tags: dev
:no-command:
.. dfhack-command:: rb
:summary: Eval() a ruby string.
.. dfhack-command:: rb_eval
:summary: Eval() a ruby string.
2022-07-31 14:28:01 -06:00
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.