Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework proxy creation in Ruby #2467

Merged
merged 6 commits into from
Jul 13, 2024
Merged

Conversation

bernardnormier
Copy link
Member

This PR allows you to create a proxy with simply FooBarPrx.new(communicator, proxyString) in Ruby.

It also updates the tests to:

  • use the new new
  • remove many extraneous uncheckedCast

Note that since Ruby doesn't support method overloading, we can't use new as an alias for uncheckedCast. So uncheckedCast stays.

@bernardnormier bernardnormier requested review from pepone and externl July 11, 2024 21:16
@@ -5,7 +5,7 @@
def batchOneways(p)
bs1 = "\0" * (10 * 1024);

batch = Test::MyClassPrx::uncheckedCast(p.ice_batchOneway())
batch = p.ice_batchOneway()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proxy factory methods in Ruby preserve types, but the tests didn't know it?

@@ -1150,9 +1150,13 @@ IceRuby_ObjectPrx_ice_staticId(VALUE /*self*/)
}

extern "C" VALUE
IceRuby_ObjectPrx_new(int /*argc*/, VALUE* /*args*/, VALUE /*self*/)
IceRuby_ObjectPrx_new(VALUE self, VALUE communicator, VALUE proxyString)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method was already provided, but not implemented!

Copy link
Member

@externl externl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@pepone
Copy link
Member

pepone commented Jul 13, 2024

we can't use new as an alias for uncheckedCast. So uncheckedCast stays.

We typically check the number of arguments and their types for such methods.

@bernardnormier
Copy link
Member Author

we can't use new as an alias for uncheckedCast. So uncheckedCast stays.

We typically check the number of arguments and their types for such methods.

I'll look into it in a follow-up PR.

@bernardnormier bernardnormier merged commit f931dae into zeroc-ice:main Jul 13, 2024
17 checks passed
@bernardnormier bernardnormier deleted the ruby-proxy branch December 9, 2024 17:07
InsertCreativityHere pushed a commit to InsertCreativityHere/compiler-comparison that referenced this pull request Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants