Project

General

Profile

Actions

Bug #16501

closed

Support marshaling of ruby2_keywords flag

Added by mame (Yusuke Endoh) over 4 years ago. Updated almost 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:96777]

Description

This patch makes Marshal.dump and load aware of ruby2_keywords flag.

https://github.com/ruby/ruby/pull/2830

def bar(key:)
  key
end

ruby2_keywords def foo(*args)
  args = Marshal.load(Marshal.dump(args))
  bar(*args)
end

foo(key: 42) #=> 42

Honestly, I'm not fully convinced if this is really needed. It would be helpful for applications and libraries that serializes the whole arguments by using Marshal, e.g., drb. (Currently, drb does not support keyword separation.) But I'm unsure how many applications does so; ActiveJob and Sidekiq use their own dedicated serialization mechanism based on JSON. This patch does not help them, and they should use #16486 to support ruby2_keywords flag. I'd like to hear opinions.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0