Last active
March 29, 2020 17:26
-
-
Save taiar/cadf7e31094528ffa2f326894be56401 to your computer and use it in GitHub Desktop.
Get list of new queues that might be created
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| '/home/taiar/***/app/workers/', | |
| '/home/taiar/***/app/workers/accounts/', | |
| '/home/taiar/***/app/workers/cards/', | |
| '/home/taiar/***/app/workers/consumers/' | |
| ].each do |path| | |
| files = Dir.glob("#{path}*").collect { |file_path| File.basename(file_path) } | |
| files.select! { | f | File.extname(f) == '.rb' } | |
| files.each { | e | require "#{path}#{e}" } | |
| end | |
| classes = ObjectSpace.each_object(Class).select { |c| c.included_modules.include? SelectQueueConcern } | |
| queues = classes.map { |c| c.to_s.underscore.tr '/', '_' } | |
| puts queues.inspect | |
| puts queues.size | |
| # ✗ r r -e development check_class_with_module.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment