From 397fa6a001514af8650a383c23556243723b83da Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 17 Oct 2019 11:22:41 +0000 Subject: [PATCH] code cleanup: rubocop: fix Style/MultilineTernaryOperator in lib/redmine/wiki_formatting.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18706 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .rubocop_todo.yml | 1 - lib/redmine/wiki_formatting.rb | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index eb7b00850..cd832171c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1131,7 +1131,6 @@ Style/MultilineTernaryOperator: - 'lib/redmine/scm/adapters/filesystem_adapter.rb' - 'lib/redmine/scm/adapters/git_adapter.rb' - 'lib/redmine/utils.rb' - - 'lib/redmine/wiki_formatting.rb' Style/MultipleComparison: Exclude: diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb index cae94d790..1dc320c47 100644 --- a/lib/redmine/wiki_formatting.rb +++ b/lib/redmine/wiki_formatting.rb @@ -34,13 +34,13 @@ module Redmine options = args.last.is_a?(Hash) ? args.pop : {} name = name.to_s raise ArgumentError, "format name '#{name}' is already taken" if @@formatters[name] - - formatter, helper, parser = args.any? ? - args : - %w(Formatter Helper HtmlParser).map {|m| "Redmine::WikiFormatting::#{name.classify}::#{m}".constantize rescue nil} - + formatter, helper, parser = + if args.any? + args + else + %w(Formatter Helper HtmlParser).map {|m| "Redmine::WikiFormatting::#{name.classify}::#{m}".constantize rescue nil} + end raise "A formatter class is required" if formatter.nil? - @@formatters[name] = { :formatter => formatter, :helper => helper,