diff options
author | Go MAEDA <maeda@farend.jp> | 2024-07-11 08:48:35 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2024-07-11 08:48:35 +0000 |
commit | 32b5992c22415ab667d78e0ef88089b0e0bf456e (patch) | |
tree | 70d6e7a11c7a7e428174ebe3d7e595f103f0f6a3 /lib | |
parent | 21e657f572af9ff37ba3cbfdb94fafc9263d8e88 (diff) | |
download | redmine-32b5992c22415ab667d78e0ef88089b0e0bf456e.tar.gz redmine-32b5992c22415ab667d78e0ef88089b0e0bf456e.zip |
Fix RuboCop offense Style/MapCompactWithConditionalBlock (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@22919 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/plugin.rb | 10 | ||||
-rw-r--r-- | lib/redmine/themes.rb | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index 17a20f5a8..3e442cd12 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -191,11 +191,11 @@ module Redmine end def asset_paths - if path.has_assets_dir? - base_dir = Pathname.new(path.assets_dir) - paths = base_dir.children.filter_map{|child| child if child.directory? } - Redmine::AssetPath.new(base_dir, paths, asset_prefix) - end + return unless path.has_assets_dir? + + base_dir = Pathname.new(path.assets_dir) + paths = base_dir.children.select(&:directory?) + Redmine::AssetPath.new(base_dir, paths, asset_prefix) end def <=>(plugin) diff --git a/lib/redmine/themes.rb b/lib/redmine/themes.rb index 191bafc21..80e846550 100644 --- a/lib/redmine/themes.rb +++ b/lib/redmine/themes.rb @@ -112,10 +112,10 @@ module Redmine def asset_paths base_dir = Pathname.new(path) - paths = base_dir.children.filter_map do |child| - child if child.directory? && - child.basename.to_s != "src" && - !child.basename.to_s.start_with?('.') + paths = base_dir.children.select do |child| + child.directory? && + child.basename.to_s != 'src' && + !child.basename.to_s.start_with?('.') end Redmine::AssetPath.new(base_dir, paths, asset_prefix) end |