dfhack/docs/plugins/ruby.rst

32 lines
474 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
2022-08-17 23:42:02 -06:00
Usage
-----
::
2022-07-31 14:28:01 -06:00
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.