From 20a57301f72c05e7e369b723f2125982452ac68e Mon Sep 17 00:00:00 2001 From: Dwayne Bailey Date: Tue, 13 Aug 2024 12:44:27 +0100 Subject: [PATCH] Add footer for newlines in Apple --- lib/twine/formatters/apple.rb | 9 +++++++++ lib/twine/formatters/apple_plural.rb | 5 ----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/twine/formatters/apple.rb b/lib/twine/formatters/apple.rb index a9fc4c7..82897a3 100644 --- a/lib/twine/formatters/apple.rb +++ b/lib/twine/formatters/apple.rb @@ -65,6 +65,15 @@ module Twine end end + def format_footer(lang) + "\n" + end + + def format_file(lang) + result = super + result += format_footer(lang) + end + def format_section_header(section) "\n/********** #{section.name} **********/" end diff --git a/lib/twine/formatters/apple_plural.rb b/lib/twine/formatters/apple_plural.rb index 64aa069..4135aef 100644 --- a/lib/twine/formatters/apple_plural.rb +++ b/lib/twine/formatters/apple_plural.rb @@ -21,11 +21,6 @@ module Twine footer = "\n\n\n" end - def format_file(lang) - result = super - result += format_footer(lang) - end - def format_header(lang) header = "<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>\n" header += "\n"