class Puppet::FileSystem::JRuby
Public Instance Methods
replace_file(path, mode = nil, &block)
click to toggle source
Calls superclass method
Puppet::FileSystem::FileImpl#replace_file
# File lib/puppet/file_system/jruby.rb 14 def replace_file(path, mode = nil, &block) 15 # MRI Ruby rename checks if destination is a directory and raises, while 16 # JRuby removes the directory and replaces the file. 17 if Puppet::FileSystem.directory?(path) 18 raise Errno::EISDIR, _("Is a directory: %{directory}") % { directory: path } 19 end 20 21 super 22 end
unlink(*paths)
click to toggle source
# File lib/puppet/file_system/jruby.rb 4 def unlink(*paths) 5 File.unlink(*paths) 6 rescue Errno::ENOENT 7 # JRuby raises ENOENT if the path doesn't exist or the parent directory 8 # doesn't allow execute/traverse. If it's the former, `stat` will raise 9 # ENOENT, if it's the later, it'll raise EACCES 10 # See https://github.com/jruby/jruby/issues/5617 11 stat(*paths) 12 end