From 4e213d77af0bcefe58f3277c4add5849ad5c1f11 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 18 Jan 2013 01:01:53 +0400 Subject: [PATCH] #794: refactoring of constants --- .../build_lists_publish_task_manager.rb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/abf_worker/build_lists_publish_task_manager.rb b/lib/abf_worker/build_lists_publish_task_manager.rb index 8866b47cf..cd4317799 100644 --- a/lib/abf_worker/build_lists_publish_task_manager.rb +++ b/lib/abf_worker/build_lists_publish_task_manager.rb @@ -3,15 +3,14 @@ module AbfWorker class BuildListsPublishTaskManager REDIS_MAIN_KEY = 'abf-worker::build-lists-publish-task-manager::' - RESIGN_REPOSITORIES = "#{REDIS_MAIN_KEY}resign-repositories" - - PROJECTS_FOR_CLEANUP = "#{REDIS_MAIN_KEY}projects-for-cleanup" - LOCKED_PROJECTS_FOR_CLEANUP = "#{REDIS_MAIN_KEY}locked-projects-for-cleanup" - - - LOCKED_REPOSITORIES = "#{REDIS_MAIN_KEY}locked-repositories" - LOCKED_REP_AND_PLATFORMS = "#{REDIS_MAIN_KEY}locked-repositories-and-platforms" - LOCKED_BUILD_LISTS = "#{REDIS_MAIN_KEY}locked-build-lists" + %w(RESIGN_REPOSITORIES + PROJECTS_FOR_CLEANUP + LOCKED_PROJECTS_FOR_CLEANUP + LOCKED_REPOSITORIES + LOCKED_REP_AND_PLATFORMS + LOCKED_BUILD_LISTS).each do |kind| + const_set kind, "#{REDIS_MAIN_KEY}#{kind.downcase.gsub('_', '-')}" + end def initialize @redis = self.redis