Note: Pathname implements chdir directly, but it is deprecated in favor of Dir.chdir
# File lib/construct/path_extensions.rb, line 43 def chdir(&block) Dir.chdir(self, &block) end
# File lib/construct/path_extensions.rb, line 47 def destroy! rmtree end
# File lib/construct/path_extensions.rb, line 6 def directory(path,chdir=construct__chdir_default) subdir = (self + path) subdir.mkpath subdir.extend(PathExtensions) subdir.maybe_change_dir(chdir) do yield(subdir) if block_given? end subdir end
# File lib/construct/path_extensions.rb, line 16 def file(filepath,contents=nil,&block) path = (self+filepath) path.dirname.mkpath File.open(path,'w') do |f| if(block) if(block.arity==1) block.call(f) else f << block.call end else f << contents end end path end
Generated with the Darkfish Rdoc Generator 2.