mirror of
https://github.com/redmine/redmine.git
synced 2025-10-26 07:46:17 +01:00
Fix RuboCop offense Style/MapCompactWithConditionalBlock (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@22919 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -22,7 +22,7 @@ require_relative '../../../test_helper'
|
||||
class Redmine::AssetPathTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
assets_dir = Rails.root.join('test/fixtures/asset_path/foo')
|
||||
paths = assets_dir.children.filter_map{|child| child if child.directory? && !child.basename.to_s.starts_with?(".")}
|
||||
paths = assets_dir.children.select { |child| child.directory? && !child.basename.to_s.starts_with?('.') }
|
||||
@asset_path = Redmine::AssetPath.new(assets_dir, paths, 'plugin_assets/foo/')
|
||||
@assets = {}
|
||||
@transition_map = {}
|
||||
|
||||
Reference in New Issue
Block a user