Re: RubySpecs

On Oct 30, 2011 12:34 AM, “Hirotsugu A.” [email protected]
wrote:

Hi, Matt,

It seems to me that this issue should be best raised on RubySpecs list.

https://groups.google.com/group/rubyspec

Thanks.

Hiro

OK. I will post it there. I hope the list is more active than the
discussion list dates would suggest.

Matt

On Oct 29, 2011, at 3:12 PM, Matt Wilbur wrote:

Hello,

Here comes stupid question time. I’ve been trying to learn JRuby, got
stuck on learning the monkeybars GUI because of a failure to load
OpenURI.
So, I thought I’d roll up my sleeves and try to pitch in to make some
RubySpecs pass. I thought I’d start with a simple-looking failing spec.
The problem is, I don’t understand the rationale, and was wondering if
anyone could give me a hand. Here it is:

it "calls #to_s on arguments that are neither Strings nor Encodings"

do

Can anyone explain? I’ve looked at the C implementation, and the only
reason I see to_str being called twice is first, to convert to a string
to
make sure that the encoding is ASCII-compatible, and then a second time
to
get a string used to look up the encoding. As far as I can tell this is
an
implementation detail, and the JRuby implementation doesn’t need the
second
call because it just uses the same string object for both the ASCII
check
and the actual encoding lookup. Perhaps I’m missing something…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs