<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/spec/ruby/core/module, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) ce849d565bf6aae8e0179fffb04eb1f665f17347, acb29f7fa1497463ed3bdd65549ef20b61beda64: [Backport #21402]</title>
<updated>2025-09-14T03:47:12+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-09-14T03:47:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e39a0a19c03fbb37d1c9d1e050bb551dccfc11c6'/>
<id>e39a0a19c03fbb37d1c9d1e050bb551dccfc11c6</id>
<content type='text'>
	ruby2_keywords warnings: Quote non-UTF8 method names fully

	It used to quote only part of the method name because NUL byte in
	the method terminates the C string:

	```
	(irb)&gt; "abcdef".encode("UTF-16LE").bytes
	=&gt; [97, 0, 98, 0, 99, 0, 100, 0, 101, 0, 102, 0]
	```

	```
	expected: /abcdef/
	actual: warning: Skipping set of ruby2_keywords flag for a (method not defined in Ruby)\n".
	```

	Do not respect ruby2_keywords on method/proc with post arguments

	Previously, ruby2_keywords could be used on a method or proc with
	post arguments, but I don't think the behavior is desired:

	```ruby
	def a(*c, **kw) [c, kw] end
	def b(*a, b) a(*a, b) end
	ruby2_keywords(:b)

	b({foo: 1}, bar: 1)
	```

	This changes ruby2_keywords to emit a warning and not set the
	flag on a method/proc with post arguments.

	While here, fix the ruby2_keywords specs for warnings, since they
	weren't testing what they should be testing.  They all warned
	because the method didn't accept a rest argument, not because it
	accepted a keyword or keyword rest argument.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	ruby2_keywords warnings: Quote non-UTF8 method names fully

	It used to quote only part of the method name because NUL byte in
	the method terminates the C string:

	```
	(irb)&gt; "abcdef".encode("UTF-16LE").bytes
	=&gt; [97, 0, 98, 0, 99, 0, 100, 0, 101, 0, 102, 0]
	```

	```
	expected: /abcdef/
	actual: warning: Skipping set of ruby2_keywords flag for a (method not defined in Ruby)\n".
	```

	Do not respect ruby2_keywords on method/proc with post arguments

	Previously, ruby2_keywords could be used on a method or proc with
	post arguments, but I don't think the behavior is desired:

	```ruby
	def a(*c, **kw) [c, kw] end
	def b(*a, b) a(*a, b) end
	ruby2_keywords(:b)

	b({foo: 1}, bar: 1)
	```

	This changes ruby2_keywords to emit a warning and not set the
	flag on a method/proc with post arguments.

	While here, fix the ruby2_keywords specs for warnings, since they
	weren't testing what they should be testing.  They all warned
	because the method didn't accept a rest argument, not because it
	accepted a keyword or keyword rest argument.
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) f69ad0e810e1fdc18dc12f77bbecfa49999ef3bf: [Backport #21094]</title>
<updated>2025-03-29T07:49:59+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-03-29T07:49:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=aac5c546cd35ff0aeab120e3724fbb1296892ae3'/>
<id>aac5c546cd35ff0aeab120e3724fbb1296892ae3</id>
<content type='text'>
	[Bug #21094] Update nested module names when setting temporary name
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #21094] Update nested module names when setting temporary name
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix keyword splat passing as regular argument</title>
<updated>2023-12-07T16:35:55+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2023-12-07T16:35:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ca204a20231f1ecabf5a7343aec49c3ea1bac90a'/>
<id>ca204a20231f1ecabf5a7343aec49c3ea1bac90a</id>
<content type='text'>
Since Ruby 3.0, Ruby has passed a keyword splat as a regular
argument in the case of a call to a Ruby method where the
method does not accept keyword arguments, if the method
call does not contain an argument splat:

```ruby
def self.f(obj) obj end
def self.fs(*obj) obj[0] end
h = {a: 1}
f(**h).equal?(h)  # Before: true; After: false
fs(**h).equal?(h) # Before: true; After: false

a = []
f(*a, **h).equal?(h)  # Before and After: false
fs(*a, **h).equal?(h) # Before and After: false
```

The fact that the behavior differs when passing an empty
argument splat makes it obvious that something is not
working the way it is intended.  Ruby 2 always copied
the keyword splat hash, and that is the expected behavior
in Ruby 3.

This bug is because of a missed check in setup_parameters_complex.
If the keyword splat passed is not mutable, then it points to
an existing object and not a new object, and therefore it must
be copied.

Now, there are 3 specs for the broken behavior of directly
using the keyword splatted hash.  Fix two specs and add a
new version guard. Do not keep the specs for the broken
behavior for earlier Ruby versions, in case this fix is
backported. For the ruby2_keywords spec, just remove the
related line, since that line is unrelated to what the
spec is testing.

Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since Ruby 3.0, Ruby has passed a keyword splat as a regular
argument in the case of a call to a Ruby method where the
method does not accept keyword arguments, if the method
call does not contain an argument splat:

```ruby
def self.f(obj) obj end
def self.fs(*obj) obj[0] end
h = {a: 1}
f(**h).equal?(h)  # Before: true; After: false
fs(**h).equal?(h) # Before: true; After: false

a = []
f(*a, **h).equal?(h)  # Before and After: false
fs(*a, **h).equal?(h) # Before and After: false
```

The fact that the behavior differs when passing an empty
argument splat makes it obvious that something is not
working the way it is intended.  Ruby 2 always copied
the keyword splat hash, and that is the expected behavior
in Ruby 3.

This bug is because of a missed check in setup_parameters_complex.
If the keyword splat passed is not mutable, then it points to
an existing object and not a new object, and therefore it must
be copied.

Now, there are 3 specs for the broken behavior of directly
using the keyword splatted hash.  Fix two specs and add a
new version guard. Do not keep the specs for the broken
behavior for earlier Ruby versions, in case this fix is
backported. For the ruby2_keywords spec, just remove the
related line, since that line is unrelated to what the
spec is testing.

Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Update to ruby/spec@bd7017f</title>
<updated>2023-10-30T12:49:46+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2023-10-30T12:49:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ab4781b64d945e962575f2eac20b72185235d23b'/>
<id>ab4781b64d945e962575f2eac20b72185235d23b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update to ruby/spec@96d1072</title>
<updated>2023-09-04T14:07:46+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2023-09-04T14:07:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0b5c61494eb30c8c1867b9e6a52ad678e3f47901'/>
<id>0b5c61494eb30c8c1867b9e6a52ad678e3f47901</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update to ruby/spec@9e278f5</title>
<updated>2023-08-02T16:53:03+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2023-08-02T16:53:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=dc54574adefe798702cc93457655da40f4939669'/>
<id>dc54574adefe798702cc93457655da40f4939669</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use the caller location as default filename for eval family of methods</title>
<updated>2023-07-24T12:51:20+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2023-07-13T09:49:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=43a5c191358699fe8b19314763998cb8ca77ed90'/>
<id>43a5c191358699fe8b19314763998cb8ca77ed90</id>
<content type='text'>
[Feature #19755]

Before (in /tmp/test.rb):

```ruby
Object.class_eval("p __FILE__") # =&gt; "(eval)"
```

After:

```ruby
Object.class_eval("p __FILE__") # =&gt; "(eval at /tmp/test.rb:1)"
```

This makes it much easier to track down generated code in case
the author forgot to provide a filename argument.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #19755]

Before (in /tmp/test.rb):

```ruby
Object.class_eval("p __FILE__") # =&gt; "(eval)"
```

After:

```ruby
Object.class_eval("p __FILE__") # =&gt; "(eval at /tmp/test.rb:1)"
```

This makes it much easier to track down generated code in case
the author forgot to provide a filename argument.
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve ArgumentError message for Module#set_temporary_name</title>
<updated>2023-07-06T16:27:13+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2023-07-06T14:34:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=055f7219bc4ace48270b09630626305784d5a87e'/>
<id>055f7219bc4ace48270b09630626305784d5a87e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Ensure the name given to Module#set_temporary_name is not a valid constant path</title>
<updated>2023-07-06T16:27:13+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2023-07-06T11:25:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9ee1877e4ab535253b4f61302b9102d20e11db5a'/>
<id>9ee1877e4ab535253b4f61302b9102d20e11db5a</id>
<content type='text'>
Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Specs for Module#set_temporary_name should be in their own file</title>
<updated>2023-07-06T16:27:13+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2023-07-06T11:32:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e76022f41cd74d297189d85d74a18d9e7821fd94'/>
<id>e76022f41cd74d297189d85d74a18d9e7821fd94</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
