kpumuk commented on code in PR #3716:
URL: https://github.com/apache/thrift/pull/3716#discussion_r3787977462


##########
lib/rb/spec/union_spec.rb:
##########
@@ -188,7 +188,7 @@
     end
 
     it "should support old style constructor" do
-      union = SpecNamespace::My_union.new(:integer32 => 26)
+      union = SpecNamespace::My_union.new(integer32: 26)
       expect(union.get_set_field).to eq(:integer32)
       expect(union.get_value).to eq(26)
     end

Review Comment:
   Not applicable. `Thrift::Union#initialize(name = nil, value = nil)` declares 
no keyword parameters, so Ruby passes this label-style argument list as the 
positional `name` Hash. The initializer intentionally supports that hash form, 
and the CI matrix passes these exact specs on Ruby 2.7, every Ruby 3.x release, 
Ruby 4.0, and Ruby head.



##########
lib/rb/spec/struct_spec.rb:
##########
@@ -178,7 +178,7 @@ def validate_default_arguments(object)
 
       expect(struct.simple).to eq(42)
       expect(struct.complex).to eq({1 => {"pi" => Math::PI, "e" => Math::E}, 
14 => {"feigenbaum" => 4.669201609}})
-      expect(struct.hello).to eq(SpecNamespace::Hello.new(:greeting => "what's 
up?"))
+      expect(struct.hello).to eq(SpecNamespace::Hello.new(greeting: "what's 
up?"))
       expect(struct.words).to eq("apple banana")
       expect(struct.ints).to eq([4, 23, 4, 29])

Review Comment:
   Not applicable. `Thrift::Struct#initialize(d = {}, &block)` declares no 
keyword parameters, so Ruby passes this label-style argument list as its single 
positional Hash. The CI matrix passes these exact specs on Ruby 2.7, every Ruby 
3.x release, Ruby 4.0, and Ruby head.



##########
lib/rb/spec/serializer_spec.rb:
##########
@@ -138,7 +138,7 @@ def get_protocol(transport)
   describe Thrift::Serializer do
     it "should serialize structs to binary by default" do
       serializer = 
Thrift::Serializer.new(Thrift::BinaryProtocolAcceleratedFactory.new)
-      data = serializer.serialize(SpecNamespace::Hello.new(:greeting => "'Ello 
guv'nor!"))
+      data = serializer.serialize(SpecNamespace::Hello.new(greeting: "'Ello 
guv'nor!"))
       expect(data).to eq("\x0B\x00\x01\x00\x00\x00\x0E'Ello guv'nor!\x00")

Review Comment:
   Not applicable. `Thrift::Struct#initialize(d = {}, &block)` declares no 
keyword parameters, so Ruby passes this label-style argument list as its single 
positional Hash. The CI matrix passes these exact specs on Ruby 2.7, every Ruby 
3.x release, Ruby 4.0, and Ruby head.



##########
lib/rb/spec/processor_spec.rb:
##########
@@ -110,7 +110,7 @@ def output_protocol
       handler = double("Handler")
       expect(handler).to receive(:unblock).with(9)
       processor = SpecNamespace::NonblockingService::Processor.new(handler)
-      args = SpecNamespace::NonblockingService::Unblock_args.new(:n => 9)
+      args = SpecNamespace::NonblockingService::Unblock_args.new(n: 9)
       input = input_protocol("unblock", Thrift::MessageTypes::CALL, 13, args)
       output_transport, output = output_protocol

Review Comment:
   Not applicable. `Thrift::Struct#initialize(d = {}, &block)` declares no 
keyword parameters, so Ruby passes this label-style argument list as its single 
positional Hash. The CI matrix passes these exact specs on Ruby 2.7, every Ruby 
3.x release, Ruby 4.0, and Ruby head.



##########
lib/rb/spec/nonblocking_server_spec.rb:
##########
@@ -33,7 +33,7 @@ def greeting(english)
       if english
         SpecNamespace::Hello.new
       else
-        SpecNamespace::Hello.new(:greeting => "Aloha!")
+        SpecNamespace::Hello.new(greeting: "Aloha!")
       end
     end

Review Comment:
   Not applicable. `Thrift::Struct#initialize(d = {}, &block)` declares no 
keyword parameters, so Ruby passes this label-style argument list as its single 
positional Hash. The CI matrix passes these exact specs on Ruby 2.7, every Ruby 
3.x release, Ruby 4.0, and Ruby head.



##########
lib/rb/spec/compact_protocol_spec.rb:
##########
@@ -465,11 +465,11 @@
 
   it "should deal with fields following fields that have non-delta ids" do
     brcp = Thrift::Test::BreaksRubyCompactProtocol.new(
-      :field1 => "blah",
-      :field2 => Thrift::Test::BigFieldIdStruct.new(
-        :field1 => "string1",
-        :field2 => "string2"),
-      :field3 => 3)
+      field1: "blah",
+      field2: Thrift::Test::BigFieldIdStruct.new(
+        field1: "string1",
+        field2: "string2"),

Review Comment:
   Not applicable. `Thrift::Struct#initialize(d = {}, &block)` declares no 
keyword parameters, so Ruby passes this label-style argument list as its single 
positional Hash. The CI matrix passes these exact specs on Ruby 2.7, every Ruby 
3.x release, Ruby 4.0, and Ruby head.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to