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

Allow tuple basename for Tempfile.{new,create} methods #792

Merged
merged 1 commit into from
Sep 16, 2021
Merged

Allow tuple basename for Tempfile.{new,create} methods #792

merged 1 commit into from
Sep 16, 2021

Conversation

ybiquitous
Copy link
Contributor

@ybiquitous ybiquitous commented Sep 15, 2021

This change allows the basename parameter receives a 2-strings tuple for the Tempfile.new and Tempfile.create methods.

The Tempfile.new doc says:

The basename parameter is used to determine the name of the temporary file.
You can either pass a String or an Array with 2 String elements. In the former
form, the temporary file's base name will begin with the given string. In the
latter form, the temporary file's base name will begin with the array's first
element, and end with the second element. For example:

This change allows the `basename` parameter receives a 2-strings tuple for
the `Tempfile.new` and `Tempfile.create` methods.

The `Tempfile.new` doc says:

> The `basename` parameter is used to determine the name of the temporary file.
> You can either pass a String or an Array with 2 String elements. In the former
> form, the temporary file's base name will begin with the given string. In the
> latter form, the temporary file's base name will begin with the array's first
> element, and end with the second element. For example:
@ybiquitous ybiquitous marked this pull request as ready for review September 15, 2021 08:08
Copy link
Member

@pocke pocke left a comment

Choose a reason for hiding this comment

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

LGTM 🌟

@pocke pocke merged commit 9f3e1db into ruby:master Sep 16, 2021
@pocke
Copy link
Member

pocke commented Sep 16, 2021

By the way, I've confirmed the tmpdir signature doesn't have the same problem ✔️

def self.mktmpdir: (?(String | [ String, String ] | nil), ?String?, ?max_try: Integer?) -> String
| [X] (?(String | [ String, String ] | nil), ?String?, ?max_try: Integer?) { (String) -> X } -> X

@ybiquitous ybiquitous deleted the allow-tuple-for-tempfile branch September 16, 2021 23:12
@ybiquitous
Copy link
Contributor Author

@pocke Thanks for the review and merge! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants