summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-04-13 04:20:25 +0000
committerGo MAEDA <maeda@farend.jp>2023-04-13 04:20:25 +0000
commit2d7d01e633a30362e665370a081e3e3bad241432 (patch)
treef8e914bc5af859d347d58080b74a1d424e11534a /lib
parentcba427ec251527442a38c977e45d755a1ae21ac7 (diff)
downloadredmine-2d7d01e633a30362e665370a081e3e3bad241432.tar.gz
redmine-2d7d01e633a30362e665370a081e3e3bad241432.zip
Export a version as changelog text (#36679).
Patch by Mizuki ISHIKAWA. git-svn-id: https://svn.redmine.org/redmine/trunk@22179 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/export/text/versions_text_helper.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/redmine/export/text/versions_text_helper.rb b/lib/redmine/export/text/versions_text_helper.rb
new file mode 100644
index 000000000..a460c4cda
--- /dev/null
+++ b/lib/redmine/export/text/versions_text_helper.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+# Redmine - project management software
+# Copyright (C) 2006-2023 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+module Redmine
+ module Export
+ module Text
+ module VersionsTextHelper
+ def version_to_text(version)
+ [
+ "# #{version.name}",
+ format_date(version.effective_date),
+ version.description,
+ version.fixed_issues.visible.map do |issue|
+ "* #{issue.tracker.name} ##{issue.id}: #{issue.subject}\n"
+ end.join
+ ].compact.join("\n\n")
+ end
+ end
+ end
+ end
+end