lib/cupper/entity.rb in cupper-0.1.1 vs lib/cupper/entity.rb in cupper-0.1.2
- old
+ new
@@ -28,10 +28,10 @@
return false if self.dir?
@template = File.read("#{TEMPLATE_PATH}/#{erb_file}.erb")
end
def save
- File.open(@full_path,"a+") { |f| f.write(self.render_template) } if self.file?
+ File.open(@full_path,"w+") { |f| f.write(self.render_template) } if self.file?
Dir.mkdir(@full_path) if self.dir? && !(self.exist?)
end
def render_template
ERB.new(@template).result(binding)