boris:falcon:~:irb
irb(main):001:0> "0".rjust( 2, "-")
ArgumentError: wrong # of arguments(2 for 1)
from (irb):1:in `rjust'
from (irb):1
irb(main):002:0> "0".rjust( 2, "-", 22 )
ArgumentError: wrong # of arguments(3 for 1)
from (irb):2:in `rjust'
from (irb):2
irb(main):003:0>
>boris:falcon:~:irb
>irb(main):001:0> "0".rjust( 2, "-")
>ArgumentError: wrong # of arguments(2 for 1)
> from (irb):1:in `rjust'
> from (irb):1
>irb(main):002:0> "0".rjust( 2, "-", 22 )
>ArgumentError: wrong # of arguments(3 for 1)
> from (irb):2:in `rjust'
> from (irb):2
>irb(main):003:0>
Linux. Seeing something else.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
"Ardanwen" <bvschmid@gmail.com> schrieb im Newsbeitrag
news:1103548501.911640.40570@f14g2000cwb.googlegroups.com...
Matt Mower wrote:
> Hi.
>
> I'm using one-click-installer Ruby 1.8.2 (2004-11-06) on WinXP-SP1
and
> I think I have a bug in the String method #rjust
>
> irb(main):002:0> "0".rjust( 2, "-" )
> => " 0"
> irb(main):003:0> "0".rjust( 2, "-", 22 )
> ArgumentError: wrong number of arguments (3 for 2)
> from (irb):3:in `rjust'
> from (irb):3
> irb(main):004:0>
>
> It's expecting 2 parameters, but ignoring the padding argument and
using spaces.
>
> Does anyone else see this?
>
> M
>
> --
> Matt Mower :: http://matt.blogs.it/
>boris:falcon:~:irb
>irb(main):001:0> "0".rjust( 2, "-")
>ArgumentError: wrong # of arguments(2 for 1)
> from (irb):1:in `rjust'
> from (irb):1
>irb(main):002:0> "0".rjust( 2, "-", 22 )
>ArgumentError: wrong # of arguments(3 for 1)
> from (irb):2:in `rjust'
> from (irb):2
>irb(main):003:0>
Linux. Seeing something else.
Works for me:
13:56:07 [source]: irbs
"0".rjust( 2 )
=> " 0"
"0".rjust( 2, "-")
=> "-0"
RUBY_VERSION
=> "1.8.1"
exit
14:17:53 [source]: uname -a
CYGWIN_NT-5.0 bond 1.5.12(0.116/4/2) 2004-11-10 08:34 i686 unknown unknown
Cygwin