noosfero | doc: force reading textile files as UTF-8

Antonio Terceiro gitlab at gitlab.com
Mon Mar 9 16:11:28 BRT 2015


Antonio Terceiro pushed to refs/heads/master at <a href="https://gitlab.com/noosfero/noosfero">Noosfero / noosfero</a>

Commits:
<a href="https://gitlab.com/noosfero/noosfero/commit/49ef3f5da97134b2ac2caf2eeedfe6aa070b19d8">49ef3f5d</a> by Antonio Terceiro
doc: force reading textile files as UTF-8

This fixes building the docs with Ruby 2.0+

- - - - -


Changes:

=====================================
lib/tasks/doc.rake
=====================================
--- a/lib/tasks/doc.rake
+++ b/lib/tasks/doc.rake
@@ -26,7 +26,8 @@ namespace :noosfero do
       begin
         require 'redcloth'
         File.open(output ,'w') do |output_file|
-          output_file.write(RedCloth.new(File.read(input)).to_html)
+          text = File.read(input, encoding: Encoding::UTF_8)
+          output_file.write(RedCloth.new(text).to_html)
           puts "#{input} -> #{output}"
         end
       rescue Exception => e

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150309/2dcf096d/attachment-0001.html>


More information about the Noosfero-dev mailing list