diff options
author | Nat Lasseter <nat.lasseter@york.ac.uk> | 2020-03-17 10:36:48 +0000 |
---|---|---|
committer | Nat Lasseter <nat.lasseter@york.ac.uk> | 2020-03-17 10:36:48 +0000 |
commit | a23831815bfb93c7f14b1643f12026e173fb5b0c (patch) | |
tree | e85df053c044773b59ff4d611d83d91c8aa83594 /lib | |
parent | aa71ddb4b8af22a5b9ca050b4ee82bc29732d344 (diff) |
Tidy logic for raider selection and fix raider 'require'ment
Diffstat (limited to 'lib')
-rw-r--r-- | lib/longboat/raiders.rb | 4 |
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 |