stdlib/tmpdir/0/tmpdir.rbs in rbs-2.0.0 vs stdlib/tmpdir/0/tmpdir.rbs in rbs-2.1.0
- old
+ new
@@ -1,10 +1,19 @@
+%a{annotate:rdoc:skip}
class Dir
+ # <!--
+ # rdoc-file=lib/tmpdir.rb
+ # - tmpdir()
+ # -->
# Returns the operating system's temporary file path.
#
def self.tmpdir: () -> String
+ # <!--
+ # rdoc-file=lib/tmpdir.rb
+ # - mktmpdir(prefix_suffix=nil, *rest, **options) { |dup| ... }
+ # -->
# Dir.mktmpdir creates a temporary directory.
#
# The directory is created with 0700 permission. Application should not change
# the permission to make the temporary directory accessible from other users.
#
@@ -31,23 +40,23 @@
# directory and its contents are removed using FileUtils.remove_entry before
# Dir.mktmpdir returns. The value of the block is returned.
#
# Dir.mktmpdir {|dir|
# # use the directory...
- # open("#{dir}/foo", "w") { ... }
+ # open("#{dir}/foo", "w") { something using the file }
# }
#
# If a block is not given, The path of the directory is returned. In this case,
# Dir.mktmpdir doesn't remove the directory.
#
# dir = Dir.mktmpdir
# begin
# # use the directory...
- # open("#{dir}/foo", "w") { ... }
+ # open("#{dir}/foo", "w") { something using the file }
# ensure
# # remove the directory.
# FileUtils.remove_entry dir
# end
#
- def self.mktmpdir: (?(String | [ String, String ] | nil), ?String?, ?max_try: Integer?) -> String
- | [X] (?(String | [ String, String ] | nil), ?String?, ?max_try: Integer?) { (String) -> X } -> X
+ def self.mktmpdir: (?String | [ String, String ] | nil, ?String?, ?max_try: Integer?) -> String
+ | [X] (?String | [ String, String ] | nil, ?String?, ?max_try: Integer?) { (String) -> X } -> X
end