Forum: Ruby ljust and rjust broken on OSX

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
martin.dufort (Guest)
on 2005-11-30 00:26
(Received via mailing list)
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 "
drbrain (Guest)
on 2005-11-30 00:34
(Received via mailing list)
On Nov 29, 2005, at 2:22 PM, kleinman wrote:

> 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"


--
Eric H. - removed_email_address@domain.invalid - http://segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com
martin.dufort (Guest)
on 2005-11-30 03:20
(Received via mailing list)
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"
----
No idea where the second one is coming from.
Thanks for the feedback - Martin
groups (Guest)
on 2005-11-30 23:15
(Received via mailing list)
On Nov 29, 2005, at 14:31, Eric H. wrote:

>
> On Nov 29, 2005, at 2:22 PM, kleinman wrote:
>
>> 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.
This topic is locked and can not be replied to.