]> source.dussan.org Git - redmine.git/commitdiff
code cleanup: rubocop: fix Layout/ElseAlignment in lib/redmine/wiki_formatting.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 17 Oct 2019 11:21:54 +0000 (11:21 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 17 Oct 2019 11:21:54 +0000 (11:21 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@18702 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
lib/redmine/wiki_formatting.rb

index 937bc2e8cb8ea390ef9170f8eecd09af95441d3f..7002203ccd33a26b58892c206aea01a909f91e73 100644 (file)
@@ -111,7 +111,6 @@ Layout/ElseAlignment:
     - 'lib/redmine/export/pdf/issues_pdf_helper.rb'
     - 'lib/redmine/i18n.rb'
     - 'lib/redmine/plugin.rb'
-    - 'lib/redmine/wiki_formatting.rb'
 
 # Cop supports --auto-correct.
 Layout/EmptyLineAfterGuardClause:
index f5a660b2940020c3226ea9721a9030d742c96132..cae94d790246380984b7bd6e9184d4a9e0ae1a2a 100644 (file)
@@ -81,15 +81,17 @@ module Redmine
       end
 
       def to_html(format, text, options = {})
-        text = if Setting.cache_formatted_text? && text.size > 2.kilobyte && cache_store && cache_key = cache_key_for(format, text, options[:object], options[:attribute])
-          # Text retrieved from the cache store may be frozen
-          # We need to dup it so we can do in-place substitutions with gsub!
-          cache_store.fetch cache_key do
+        text =
+          if Setting.cache_formatted_text? && text.size > 2.kilobyte && cache_store &&
+              cache_key = cache_key_for(format, text, options[:object], options[:attribute])
+            # Text retrieved from the cache store may be frozen
+            # We need to dup it so we can do in-place substitutions with gsub!
+            cache_store.fetch cache_key do
+              formatter_for(format).new(text).to_html
+            end.dup
+          else
             formatter_for(format).new(text).to_html
-          end.dup
-        else
-          formatter_for(format).new(text).to_html
-        end
+          end
         text
       end