2022-07-25 07:08:59 -06:00
|
|
|
.. _rb:
|
|
|
|
|
2022-07-10 00:01:46 -06:00
|
|
|
ruby
|
|
|
|
====
|
2022-07-31 14:28:01 -06:00
|
|
|
|
2022-08-09 23:37:24 -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.
|