ljust and rjust broken on OSX

K

kleinman

ruby 1.8.2 (2004-11-03) [powerpc-darwin7.5.0]
tripus% irb
irb(main):001:0> "test".rjust(5,"x")
=> " test"
irb(main):002:0> "test".ljust(5, "x")
=> "test "
 
E

Eric Hodel

ruby 1.8.2 (2004-11-03) [powerpc-darwin7.5.0]
^^^^^^^^^^

That's not 1.8.2, 1.8.2 was released 2004-12-25
tripus% irb
irb(main):001:0> "test".rjust(5,"x")
=> " test"
irb(main):002:0> "test".ljust(5, "x")
=> "test "

$ ruby182-orig -v
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]
$ ruby182-orig -e 'p "test".rjust(5, "x")'
"xtest"
$ ruby182-orig -e 'p "test".ljust(5, "x")'
"testx"
$ ruby183 -v
ruby 1.8.3 (2005-09-21) [powerpc-darwin8.2.0]
$ ruby183 -e 'p "test".ljust(5, "x")'
"testx"
$ ruby183 -e 'p "test".rjust(5, "x")'
"xtest"
 
K

kleinman

Thanks Eric. Your reply prompted me to see how many ruby were installed
on my PB.

Seems I had 2:
/local/bin/ruby
/bin/ruby
------
tripus% ./bin/ruby -v
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]
tripus% ./bin/ruby -e 'p "test".rjust(5,"x")'
"xtest"

tripus% ./local/bin/ruby -v
ruby 1.8.2 (2004-11-03) [powerpc-darwin7.5.0]
tripus% ./local/bin/ruby -e 'p "test".rjust(5,"x")'
" test"
 
D

Dave Howell

ruby 1.8.2 (2004-11-03) [powerpc-darwin7.5.0]
^^^^^^^^^^

That's not 1.8.2, 1.8.2 was released 2004-12-25

It is 1.8.2. It's a pre-release. I spent a lot of time trying to figure
out why things didn't work the way they were supposed to until I found
out I had "the other 1.8.2", and I needed to upgrade my install of
1.8.2 to 1.8.2.

Mutter mutter fume.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top