From a23831815bfb93c7f14b1643f12026e173fb5b0c Mon Sep 17 00:00:00 2001 From: Nat Lasseter Date: Tue, 17 Mar 2020 10:36:48 +0000 Subject: Tidy logic for raider selection and fix raider 'require'ment --- lib/longboat/raiders.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/longboat/raiders.rb') diff --git a/lib/longboat/raiders.rb b/lib/longboat/raiders.rb index e27ac0b..3e6f246 100644 --- a/lib/longboat/raiders.rb +++ b/lib/longboat/raiders.rb @@ -9,12 +9,12 @@ module Longboat next unless Dir.exist?(dir) Dir.entries(dir).each do |file| - next if file =~ /^\./ + next unless file =~ /\A(?!:[^.]).*[^_].*\.rb\Z/ reqname = File.basename(file, ".rb") cname = reqname.split('_').map(&:capitalize).join - require "raiders/#{reqname}" + require "#{dir}/#{reqname}" @raiders[reqname] = Kernel.const_get(cname).new(@collector, raider_config) end end -- cgit v1.2.1