Skip to content

Commit

Permalink
Improve atomic_write sig
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Jan 12, 2024
1 parent fad048e commit 737a61d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Library/Homebrew/extend/file/atomic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ class File
# file.write('hello')
# end
sig {
params(
type_parameters(:out).params(
file_name: T.any(Pathname, String),
temp_dir: String,
_block: T.proc.params(arg0: Tempfile).void,
).void
_block: T.proc.params(arg0: Tempfile).returns(T.type_parameter(:out)),
).returns(T.type_parameter(:out))
}
def self.atomic_write(file_name, temp_dir = dirname(file_name), &_block)
require "tempfile" unless defined?(Tempfile)
Expand Down

0 comments on commit 737a61d

Please sign in to comment.