lib/xcmultilingual/writer.rb in xcmultilingual-0.1.7 vs lib/xcmultilingual/writer.rb in xcmultilingual-0.2.0

- old
+ new

@@ -10,23 +10,23 @@ @template_path = template_path() @filename = File.basename(@destination) end def write - puts "+ START UPDATING\n\n" if @verbose + puts "[START UPDATING]" if @verbose if !File.exist?("#{@destination}") - puts " There is no destination file." if @verbose + puts "There is no destination file." if @verbose puts "\n+ FAILED UPDATING\n" if @verbose - return + exit 2 end File.open("#{@destination}", "w") do |file| path = File.expand_path(@template_path) body = ERB.new(File.open(path).read, nil, '-').result(binding) file.write(body) end - puts "+ END UPDATING\n\n" if @verbose + puts "[END UPDATING]" if @verbose end private def template_path()