summaryrefslogtreecommitdiff
path: root/lib/tempfile.rb
diff options
context:
space:
mode:
authorsonots <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-26 05:45:29 +0000
committersonots <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-26 05:45:29 +0000
commit64f53f0dbfd103d3c0d5c567a849251ce6466086 (patch)
tree82cda88d035d017d0ff9427f8b65d250f2826137 /lib/tempfile.rb
parent8d501ec021010dbfdd29d92155bebd82960ad1f1 (diff)
* lib/tempfile.rb: provide default basename parameter
for Tempfile.create. [Feature #11965] Patch by Yuki Kurihara * test/test_tempfile.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r--lib/tempfile.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index 223637f84a..b0ebd0be0e 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -323,7 +323,7 @@ end
# ... do something with f ...
# end
#
-def Tempfile.create(basename, tmpdir=nil, mode: 0, **options)
+def Tempfile.create(basename="", tmpdir=nil, mode: 0, **options)
tmpfile = nil
Dir::Tmpname.create(basename, tmpdir, options) do |tmpname, n, opts|
mode |= File::RDWR|File::CREAT|File::EXCL