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