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.

This command

@show #1


Produces this error

11-12-29 22:10:46 [FATAL] (Character) Caught ArgumentError: flag after width
./lib/core/root.rb:44:in `sprintf'
./lib/core/root.rb:44:in `inspect'
./lib/core/root.rb:43:in `each'
./lib/core/root.rb:43:in `inspect'
./cmd/teensy/cmd_show.rb:22:in `cmd_show'
./lib/core/character.rb:95:in `send'
./lib/core/character.rb:95:in `parse'



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.
30 Dec, 2011, Tyche wrote in the 2nd comment:
Votes: 0
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?
18 Jan, 2012, Trask wrote in the 4th comment:
Votes: 0
Chris Bailey said:
having only fixed the setsockopt parameter bug.


Can you give me a link to this bugfix please Chris? I'm considering mucking around with this codebase a bit. Do many people use teensymud?
21 Jan, 2012, Chris Bailey wrote in the 5th comment:
Votes: 0
Just noticed your post Trask, sorry for the delay.

http://www.mudbytes.net/index.php?a=topi...

As for your second question, what is your definition of many? =)
21 Jan, 2012, Trask wrote in the 6th comment:
Votes: 0
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.
21 Jan, 2012, Tyche wrote in the 7th comment:
Votes: 0
TeensyMud 2.10.1 released which fixes both bugs discussed here.
22 Jan, 2012, Trask wrote in the 8th comment:
Votes: 0
Cheers Tyche
0.0/8