aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNat Lasseter <nat.lasseter@york.ac.uk>2020-03-17 10:36:48 +0000
committerNat Lasseter <nat.lasseter@york.ac.uk>2020-03-17 10:36:48 +0000
commita23831815bfb93c7f14b1643f12026e173fb5b0c (patch)
treee85df053c044773b59ff4d611d83d91c8aa83594 /lib
parentaa71ddb4b8af22a5b9ca050b4ee82bc29732d344 (diff)
Tidy logic for raider selection and fix raider 'require'ment
Diffstat (limited to 'lib')
-rw-r--r--lib/longboat/raiders.rb4
1 files changed, 2 insertions, 2 deletions
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