]> source.dussan.org Git - redmine.git/commitdiff
shorten long line of lib/redmine/my_page.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 5 Oct 2020 15:47:18 +0000 (15:47 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 5 Oct 2020 15:47:18 +0000 (15:47 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20122 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/my_page.rb

index f73ef83e331f1305326510b1e7dbefe803313632..3310e9a9a0af729757343316f9919ac2af3eaf27 100644 (file)
@@ -77,11 +77,14 @@ module Redmine
 
     # Returns the additional blocks that are defined by plugin partials
     def self.additional_blocks
-      @@additional_blocks ||= Dir.glob("#{Redmine::Plugin.directory}/*/app/views/my/blocks/_*.{rhtml,erb}").inject({}) do |h,file|
-        name = File.basename(file).split('.').first.gsub(/^_/, '')
-        h[name] = {:label => name.to_sym, :partial => "my/blocks/#{name}"}
-        h
-      end
+      @@additional_blocks ||=
+        Dir.glob(
+          "#{Redmine::Plugin.directory}/*/app/views/my/blocks/_*.{rhtml,erb}"
+        ).inject({}) do |h, file|
+          name = File.basename(file).split('.').first.gsub(/^_/, '')
+          h[name] = {:label => name.to_sym, :partial => "my/blocks/#{name}"}
+          h
+        end
     end
 
     # Returns the default layout for My Page