Created
December 13, 2016 22:59
-
-
Save kml/47ae09c02bb66360f8c88dbf4ae2a0e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# In JRuby, Tempfile is implemented in Java. We were able to improve the performance substantially, | |
# and avoid the buggy stdlib version in the process. | |
# -- Nick Sieger | |
# http://stackoverflow.com/questions/1466460/jruby-tempfile-rb | |
# JRuby: Tempfile.new('p').path => "/tmp/p.4642.20811" | |
# 1.9.3: Tempfile.new('p').path => "/tmp/p20120426-4327-19gcrqi" | |
# Ujednolicenie generowanej nazwy pliku tymczasowego: | |
require 'tempfile' | |
require 'tmpdir' | |
class Tempfile | |
def make_tmpname(prefix_suffix, n) | |
Dir::Tmpname.make_tmpname(prefix_suffix, n) | |
end | |
end if defined?(JRUBY_VERSION) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment