From 65d501710aa3c4d4fdabbd41344b501e86fc336c Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Date: Mon, 26 Feb 2018 13:32:14 +0200
Subject: [PATCH] Reorganize plugins dir structure

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
---
 lib/gitlab/plugin.rb                             | 5 +++--
 plugins/enabled/.gitkeep                         | 0
 plugins/{available => examples}/save_to_file.clj | 0
 plugins/{available => examples}/save_to_file.rb  | 0
 4 files changed, 3 insertions(+), 2 deletions(-)
 delete mode 100644 plugins/enabled/.gitkeep
 rename plugins/{available => examples}/save_to_file.clj (100%)
 rename plugins/{available => examples}/save_to_file.rb (100%)

diff --git a/lib/gitlab/plugin.rb b/lib/gitlab/plugin.rb
index 1035d2589078..be5d6d6b1c10 100644
--- a/lib/gitlab/plugin.rb
+++ b/lib/gitlab/plugin.rb
@@ -1,12 +1,13 @@
 module Gitlab
   module Plugin
     def self.files
-      Dir.glob(Rails.root.join('plugins/enabled/*'))
+      Dir.glob(Rails.root.join('plugins/*')).select do |entry|
+        File.file?(entry)
+      end
     end
 
     def self.execute_all_async(data)
       files.each do |file|
-        puts file
         PluginWorker.perform_async(file, data)
       end
     end
diff --git a/plugins/enabled/.gitkeep b/plugins/enabled/.gitkeep
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/plugins/available/save_to_file.clj b/plugins/examples/save_to_file.clj
similarity index 100%
rename from plugins/available/save_to_file.clj
rename to plugins/examples/save_to_file.clj
diff --git a/plugins/available/save_to_file.rb b/plugins/examples/save_to_file.rb
similarity index 100%
rename from plugins/available/save_to_file.rb
rename to plugins/examples/save_to_file.rb
-- 
GitLab