incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tong Li <liton...@us.ibm.com>
Subject Re: [PATCH] fix cloud entry point xml/json bugs caused by the collection changes
Date Thu, 13 Oct 2011 15:04:12 GMT

Yes, I have been using Ruby 1.9.

Thanks.

Tong Li
Emerging Technologies & Standards
B062/K317
litong01@us.ibm.com



From:	Scott Seago <sseago@redhat.com>
To:	deltacloud-dev@incubator.apache.org
Date:	10/13/2011 10:47 AM
Subject:	Re: [PATCH] fix cloud entry point xml/json bugs caused by the
            collection changes



On 10/13/2011 09:15 AM, Tong Li wrote:
>>> \ No newline at end of file
>>> >  >  +  - @collections.each do|api|
>>> >  >  +    - res_name = api[0].to_s.gsub(/_[a-z]/) {|match|  match
>> >  [1].to_s.upcase }
>> >
>> >  There's a little Ruby surprise for you: match[1] is actually an
integer;
>> >  and "ab"[1].to_s.upcase == "98"
> used irb and run "ab"[1].to_s.upcase, I got "B" as I expected. This is
> using Ruby
>
> C:\Users\IBM_ADMIN>irb
> irb(main):001:0>  "ab"[1].to_s.upcase
> =>  "B"
This is a ruby 1.8/1.9 issue.

Looks like David is using Ruby 1.8 and you're using 1.9. The []
operation on string changed between the two:

http://www.ruby-doc.org/core-1.8.6/String.html#method-i-5B-5D

vs.

http://www.ruby-doc.org/core-1.9.2/String.html#method-i-5B-5D

Scott


Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message