| Server IP : 77.68.64.21 / Your IP : 216.73.217.105 Web Server : Apache System : Linux hp3-wp-1011378.hostingp3.local 3.10.0-1160.144.1.el7.tuxcare.els9.x86_64 #1 SMP Fri Jul 10 17:06:31 UTC 2026 x86_64 User : csh2668128 ( 2112425) PHP Version : 8.1.34 Disable Function : shell_exec,exec,system,popen,set_time_limit MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/ruby/vendor_ruby/puppet/file_system/ |
Upload File : |
# An in-memory file abstraction. Commonly used with Puppet::FileSystem::File#overlay
# @api private
class Puppet::FileSystem::MemoryFile
attr_reader :path, :children
def self.a_missing_file(path)
new(path, :exist? => false, :executable? => false)
end
def self.a_regular_file_containing(path, content)
new(path, :exist? => true, :executable? => false, :content => content)
end
def self.an_executable(path)
new(path, :exist? => true, :executable? => true)
end
def self.a_directory(path, children = [])
new(path,
:exist? => true,
:excutable? => true,
:directory? => true,
:children => children)
end
def initialize(path, properties)
@path = path
@properties = properties
@children = (properties[:children] || []).collect do |child|
child.duplicate_as(File.join(@path, child.path))
end
end
def directory?; @properties[:directory?]; end
def exist?; @properties[:exist?]; end
def executable?; @properties[:executable?]; end
def each_line(&block)
handle.each_line(&block)
end
def handle
raise Errno::ENOENT unless exist?
StringIO.new(@properties[:content] || '')
end
def duplicate_as(other_path)
self.class.new(other_path, @properties)
end
def absolute?
Pathname.new(path).absolute?
end
def to_path
path
end
def to_s
to_path
end
# Used by Ruby 1.8.7 file system abstractions when operating on Pathname like things.
def to_str
to_path
end
def inspect
"<Puppet::FileSystem::MemoryFile:#{to_s}>"
end
end