From 6bfbf1458483dacf6503e6493066574f875ccbd3 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sun, 25 Dec 2022 16:44:56 +0900 Subject: [PATCH] Suppress `Layout/ClassStructure` offense Follow up https://github.com/rubocop/rubocop/pull/11329 --- tasks/changelog.rb | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tasks/changelog.rb b/tasks/changelog.rb index 5923c5205a..e446e5a30b 100644 --- a/tasks/changelog.rb +++ b/tasks/changelog.rb @@ -77,6 +77,19 @@ def github_user user end end + + def self.pending? + entry_paths.any? + end + + def self.entry_paths + Dir["#{ENTRIES_PATH}*"] + end + + def self.read_entries + entry_paths.to_h { |path| [path, File.read(path)] } + end + attr_reader :header, :rest def initialize(content: File.read(PATH), entries: Changelog.read_entries) @@ -107,18 +120,6 @@ def merge_content merged_content << EOF end - def self.pending? - entry_paths.any? - end - - def self.entry_paths - Dir["#{ENTRIES_PATH}*"] - end - - def self.read_entries - entry_paths.to_h { |path| [path, File.read(path)] } - end - def new_contributor_lines contributors .map { |user| format(CONTRIBUTOR, user: user) }