diff --git a/.rubocop.yml b/.rubocop.yml index 3decd1775..92c0ca43f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -279,5 +279,3 @@ Style/AccessModifierIndentation: Enabled: false Lint/Loop: Enabled: false -Style/For: - Enabled: false diff --git a/config/routes.rb b/config/routes.rb index 29d8d4801..3770fcc2f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,12 +11,12 @@ Zammad::Application.routes.draw do # load routes from external files dir = File.expand_path('../', __FILE__) files = Dir.glob( "#{dir}/routes/*.rb" ) - for file in files + files.each { |file| if Rails.configuration.cache_classes require file else load file end - end + } end diff --git a/lib/session_helper.rb b/lib/session_helper.rb index ae97d7210..6df31f078 100644 --- a/lib/session_helper.rb +++ b/lib/session_helper.rb @@ -8,10 +8,10 @@ module SessionHelper # load collections to deliver from external files dir = File.expand_path('../../', __FILE__) files = Dir.glob( "#{dir}/app/controllers/sessions/collection_*.rb" ) - for file in files + files.each { |file| load file (default_collection, assets ) = ExtraCollection.session( default_collection, assets, user ) - end + } [default_collection, assets] end diff --git a/lib/sessions/backend/collections.rb b/lib/sessions/backend/collections.rb index 34b0111e2..8e062e52b 100644 --- a/lib/sessions/backend/collections.rb +++ b/lib/sessions/backend/collections.rb @@ -29,7 +29,7 @@ class Sessions::Backend::Collections # load collections to deliver from external files dir = File.expand_path('../../../../', __FILE__) files = Dir.glob( "#{dir}/lib/sessions/backend/collections/*.rb" ) - for file in files + files.each { |file| file.gsub!("#{dir}/lib/", '') file.gsub!(/\.rb$/, '') next if file.classify == 'Sessions::Backend::Collections::Base' @@ -39,7 +39,7 @@ class Sessions::Backend::Collections if backend backends.push backend end - end + } backends end