Note: Pathname implements # directly, but it is deprecated in favor of Dir.chdir
# File lib/construct/path_extensions.rb, line 43 43: def chdir(&block) 44: Dir.chdir(self, &block) 45: end
# File lib/construct/path_extensions.rb, line 47 47: def destroy! 48: rmtree 49: end
# File lib/construct/path_extensions.rb, line 6 6: def directory(path,chdir=construct__chdir_default) 7: subdir = (self + path) 8: subdir.mkpath 9: subdir.extend(PathExtensions) 10: subdir.maybe_change_dir(chdir) do 11: yield(subdir) if block_given? 12: end 13: subdir 14: end
# File lib/construct/path_extensions.rb, line 16 16: def file(filepath,contents=nil,&block) 17: path = (self+filepath) 18: path.dirname.mkpath 19: File.open(path,'w') do |f| 20: if(block) 21: if(block.arity==1) 22: block.call(f) 23: else 24: f << block.call 25: end 26: else 27: f << contents 28: end 29: end 30: path 31: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.