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

Dir.mktmpdir and File.join accept Pathname #2158

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

znz
Copy link
Member

@znz znz commented Dec 16, 2024

File.join uses FilePathStringValue, so it accepts Pathname.

https://github.com/ruby/ruby/blob/7c2660b34774c017accff8a7d78371c2f368b9dc/file.c#L5160

Dir.mktmpdir uses File.join internally, so it also accepts Pathname as parent.
And it use String.try_convert for prefix_suffix, so they accept string instead of String.

https://github.com/ruby/ruby/blob/923f831804b8bc26bf0412b932791d9090ff8ac4/lib/tmpdir.rb#L159-L165

@soutaro
Copy link
Member

soutaro commented Dec 17, 2024

@znz Thanks! Can you add some tests to File_test.rb?

We don't have good place for Dir.mktmpdir tests. It will be really great if you can rewrite the test cases in Dir_tmpdir_test.rb. (It has only two test methods, not too difficult.)

@soutaro soutaro added this to the RBS 3.8 milestone Dec 17, 2024
@soutaro soutaro force-pushed the relax-Dir.tmpdir-and-File.join branch from 53b0dc1 to fcc51c8 Compare December 23, 2024 04:00
@soutaro soutaro enabled auto-merge December 23, 2024 04:00
@soutaro soutaro force-pushed the relax-Dir.tmpdir-and-File.join branch from fcc51c8 to 4f85547 Compare December 23, 2024 04:31
@soutaro soutaro added this pull request to the merge queue Dec 23, 2024
Merged via the queue into ruby:master with commit f3dc5d7 Dec 23, 2024
19 checks passed
@soutaro soutaro added the Released PRs already included in the released version label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released PRs already included in the released version
Development

Successfully merging this pull request may close these issues.

2 participants