Methods
- A
- C
- D
- F
- N
- P
Instance Public methods
copies directories and files from the real filesystem into our fake one
# File lib/fakefs/file_system.rb, line 49 def clone(path) path = File.expand_path(path) pattern = File.join(path, '**', '*') files = RealFile.file?(path) ? [path] : [path] + RealDir.glob(pattern, RealFile::FNM_DOTMATCH) files.each do |f| if RealFile.file?(f) FileUtils.mkdir_p(File.dirname(f)) File.open(f, File::WRITE_ONLY) do |g| g.print RealFile.open(f){|h| h.read } end elsif RealFile.directory?(f) FileUtils.mkdir_p(f) elsif RealFile.symlink?(f) FileUtils.ln_s() end end end