dfhack
dfhack copied to clipboard
Turn down ruby support
If you intend to port a script, please make a comment on this bug to "claim" it so others don't start working on it too.
- [x] ./devel/scanitemother.rb DFHack/scripts#533
- [x] ./devel/spawn-unit-helper.rb DFHack/scripts#545
- [x] ./devel/unforbidall.rb DFHack/scripts#382
- [x] ./fix/loyaltycascade.rb DFHack/scripts#542
- [x] ./fix/stuckdoors.rb DFHack/scripts#480
- [x] ./adaptation.rb DFHack/scripts#479
- [x] ./ban-cooking.rb DFHack/scripts#479
- [x] ./create-items.rb DFHack/scripts#546
- [x] ./deathcause.rb DFHack/scripts#488
- [x] ./deteriorateclothes.rb DFHack/scripts#384
- [x] ./deterioratecorpses.rb DFHack/scripts#384
- [x] ./deterioratefood.rb DFHack/scripts#384
- [x] ./digfort.rb [removed] DFHack/scripts#332
- [x] ./exterminate.rb DFHack/scripts#541
- [x] ./growcrops.rb DFHack/scripts#487
- [x] ./lever.rb DFHack/scripts/pull/515
- [x] ./locate-ore.rb DFHack/scripts#489
- [x] ./masspit.rb DFHack/scripts#531
- [x] ./modtools/spawn-liquid.rb DFHack/scripts#540
- [x] ./multicmd.rb DFHack/scripts#383
- [ ] ./show-unit-syndromes.rb DFHack/scripts#562
- [x] ./source.rb DFHack/scripts#492
- [x] ./startdwarf.rb DFHack/scripts#385
- [x] ./starvingdead.rb DFHack/scripts#537
- [x] ./stripcaged.rb DFHack/scripts#522
- [x] ./superdwarf.rb DFHack/scripts#491
- [x] ./unforbid.rb DFHack/scripts#382
has multiple external dependencies that users have to separately install on their systems
It's not supposed to. libruby is the only one I can think of - we try to provide a build that should work for everyone, but it isn't always possible. It doesn't work out of the box on some uncommon Linux situations and new versions of macOS: #1742, #1718
Edit: I see #2023 as well. Missed those replies. I guess this falls under "uncommon Linux situations"?
We'll need a deprecation plan to inform users that ruby is going away and give them time to rewrite any personal ruby scripts. How about we do this in stages, one stage per release:
- port all in-repo ruby scripts to lua; print a deprecation notice to the dfhack console whenever a ruby script is run.
- require specific action by the user to load the ruby plugin. e.g. they have to manually move the file to the plugins directory or run a specific dfhack command
- remove the ruby plugin from the repo
Removed rbsandbox.rb
from the list - that was a private script of mine.
I think multicmd
should be a built-in - I may have expressed this before. I'm willing to take on some of these.
I think
multicmd
should be a built-in - I may have expressed this before.
Ha, I should have read this before I did that last port. We can choose to merge that PR (or not) and make multicmd
a builtin later.
I guess what I really should have decided on is "not Ruby". It's pretty safe to rely on Lua being available - much more so than Ruby. String manipulation is also a bit easier/safer in Lua, as I'm sure you've found with argument parsing. Really the only risk I see is that people can edit/delete multicmd.lua, but it's not essential enough in my book that we should rewrite it.
I'm willing to take on some of these.
There are some that could certainly use your expertise:
-
startdwarf
does some direct memory manipulation that I haven't tried before -
ban-cooking
comments are full of conjecture that might benefit from your knowledge -
create-items
needs a decision on whether it should be replaced by the existingmodtools/create-item.lua
script (or the plugin? see #1012)
Looking at startdwarf now. Not a one-to-one API change, apparently
huh... i was sure that there was startdwarf in lua already...
Edit; seems that i failed to port it from an old many-in-one tool
I'm looking at superdwarf
next. It looks like most of the functionality is copied from the fastdwarf
plugin. I think the best way forward for this one is to move the superdwarf
command to the fastdwarf
plugin and just have that plugin provide both commands.
edit [myk002]: checklist moved to initial comment since the volume of comments on this issue has hidden this comment until you expand the list
Thank you for that list! it's beautiful!
Just saw a message in discord from myk002 about claiming scripts in this issue.
I have added a PR to port growcrops.rb to lua DFHack/Scripts#487
I am also claiming the conversion of deathcause.rb PR to follow soonish
updated the tracker.
I guess I'll claim stripcaged.rb as I might be halfway finished now. If anyone else has started it as well or wants to, contact me in the discord and we can share notes.
Claiming masspit.rb
, I will take a crack at this week.
EDIT: https://github.com/DFHack/scripts/pull/531
Lever is at https://github.com/DFHack/scripts/pull/515
I took spawn-liquid.rb
too, https://github.com/DFHack/scripts/pull/532
scanitemother.rb
is done over at https://github.com/DFHack/scripts/pull/533
I will tackle starvingdead.rb
and exterminate.rb
this week.
starvingdead.rb ported over at https://github.com/DFHack/scripts/pull/537 exterminate.rb over at https://github.com/DFHack/scripts/pull/541