[
https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Stockton updated THRIFT-374:
------------------------------------
Attachment: thrift-374.patch
Here are a few notes I put together to summarize my changes.
o Ruby 1.9 is not compatible with rspec 1.1.12. Specifically, .and_return
doesn't allow for multiple values. And, stub_everything("trans") must now be
declared like so: mock("trans").as_null_object. To test thrift against 1.9, you
must install version 1.1.99.9 from rspec's trunk.
fail: mock("Foo").should_receive(:bar).with(1).and_return(2,4)
pass: mock("Foo").should_receive(:bar).with(1).and_return(4)
o A macro exists in 1.9 to extract a float's value but it doesn't exist in 1.8.
RFLOAT(rb_Float(v))->value is incompatible with 1.9.
o Replaced RSTRING(str)->len and RSTRING(str)->ptr with forward compatible
RSTRING_LEN and RSTRING_PTR.
o Excluded :object_id from the list of methods undefined in deprecation proxies
to avoid a bunch of warnings.
o Check for range errors manually in binary protocol's write_byte and
write_i64. Ruby 1.9 doesn't seem to mind packing values greater than a format
specification description calls for.
o In ruby 1.8, String.new('monkey')[0] returns an ascii value. In 1.9, it
returns a string. Therefore, .ord must be called explicitly.
o Forced ascii-8bit string encoding in transport with a magic comment.
Otherwise, two strings with a different encoding do not appear equal when their
printed contents are the same.
'Thrift::BinaryProtocolAccelerated should write the message header' FAILED
expected: "\x80\x01\x00\x01\x00\x00\x00\vtestMessage\x00\x00\x00\x11",
got: "\x80\x01\x00\x01\x00\x00\x00\vtestMessage\x00\x00\x00\x11" (using ==)
o case statements must use 'then', instead of, ':'.
case (x += 1)
when 1: raise Thrift::TransportException
end
case (x += 1)
when 1 then raise Thrift::TransportException
end
o I didn't make deprecation and its associated specs compatible with 1.9 since
there is an open ticket to remove deprecation support.
o Mongrel is not ported to ruby 1.9 which will cause httpserver to fail.
o There are a few tests for nonblockingserver that are failing. I can't seem
to figure out why. It seems the problem may be in the way the spec is merely
shutting down a nonblocking server.
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Attachments: thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.