# 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