lib/skellington/template.rb in skellington-0.4.11 vs lib/skellington/template.rb in skellington-0.4.13
- old
+ new
@@ -19,12 +19,12 @@
end
def write
print "Generating #{Skellington.unslash outpath}..."
FileUtils.mkdir_p File.dirname outpath
- f = File.open outpath, 'w'
- f.write self
- f.close
+ File.open outpath, 'w' do |f|
+ f.write self
+ end
puts 'done'
end
def to_s
t = File.read(File.open("#{templates_dir}/#{@name}.eruby"))