Kouhei Sutou
null+****@clear*****
Sun Feb 23 23:40:08 JST 2014
Kouhei Sutou 2014-02-23 23:40:08 +0900 (Sun, 23 Feb 2014) New Revision: fa7cfcd1ce3a6cee4ff2d28c9ef81b4a58052ed2 https://github.com/droonga/droonga.org/commit/fa7cfcd1ce3a6cee4ff2d28c9ef81b4a58052ed2 Message: task: use here document Modified files: Rakefile Modified: Rakefile (+11 -9) =================================================================== --- Rakefile 2014-02-23 23:37:08 +0900 (8177e46) +++ Rakefile 2014-02-23 23:40:08 +0900 (2bdb05d) @@ -29,19 +29,21 @@ I18nTask.define do |task| task.files -= Rake::FileList["#{locale}/**/*.md"] end task.custom_translator = lambda do |original, translated, path| - notice = "{% comment %}\n" + - "##############################################\n" + - " THIS FILE IS AUTOMATICALLY GENERATED FROM\n" + - " \"#{path.po_file}\"\n" + - " DO NOT EDIT THIS FILE MANUALLY!\n" + - "##############################################\n" + - "{% endcomment %}" + notice = <<-NOTICE +{% comment %} +############################################## + THIS FILE IS AUTOMATICALLY GENERATED FROM + "#{path.po_file}" + DO NOT EDIT THIS FILE MANUALLY! +############################################## +{% endcomment %} + NOTICE if /^---+$/ =~ translated translated = translated.split(/^---+\n/) - translated[2] = "\n#{notice}\n\n#{translated[2]}" + translated[2] = "\n#{notice}\n#{translated[2]}" translated.join("---\n") else - "\n#{notice}\n\n#{translated}" + "\n#{notice}\n#{translated}" end end end -------------- next part -------------- HTML����������������������������...Download