30 Dec, 2011, Chris Bailey wrote in the 1st comment:
Votes: 0
In Teensymud 2.10.0, there is a bug in inspect method of Root class, as evidenced by use of the @show command.
On a fresh install of Teensymud, using the ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux] platform, and having only fixed the setsockopt parameter bug.
Here is our culprit, the inspect method of Root (lib/core/root.rb)
# formatted dump of object properties # [+return+] a string def inspect s = '' @props.each do |key,val| s << sprintf("%20-20s : %40-40s\n", key.to_s, val.inspect) end s end
For the time being, I have fixed it by changing it to
# formatted dump of object properties # [+return+] a string def inspect s = '' @props.each do |key,val| s << sprintf("%s : %s\n", key.to_s, val.inspect) end s end
A temporary fix for sure. If Tyche can recall exactly what functionality he had intended with that method; I'd be glad to submit a proper solution.
The intent is to print the properties in left justified fixed-width columns.
It should be changed to: s << sprintf("%-20.20s : %-40.40s\n", key.to_s, val.inspect)
30 Dec, 2011, Chris Bailey wrote in the 3rd comment:
Votes: 0
Ah good. That is how I changed it for my own Teensy based codebase. I just didn't want to assume any functionality for others. Should I submit a diff, or do you have it taken care of?
Thanks for the link mate, nevermind the second question, upon reflection I'm not sure why I asked it. I just wanted to get a feel for how much support there was out there for this codebase.
On a fresh install of Teensymud, using the ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux] platform, and having only fixed the setsockopt parameter bug.
This command
Produces this error
Here is our culprit, the inspect method of Root (lib/core/root.rb)
For the time being, I have fixed it by changing it to
A temporary fix for sure. If Tyche can recall exactly what functionality he had intended with that method; I'd be glad to submit a proper solution.