From 772064b3ecfe762bbceff3d23d18aa2177e90f91 Mon Sep 17 00:00:00 2001 From: Nat Lasseter Date: Mon, 9 Nov 2020 17:25:46 +0000 Subject: Fix and clarify convoluted and buggy raider filename check regexp --- lib/longboat/raiders.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/longboat/raiders.rb') diff --git a/lib/longboat/raiders.rb b/lib/longboat/raiders.rb index cd93858..eb30612 100644 --- a/lib/longboat/raiders.rb +++ b/lib/longboat/raiders.rb @@ -9,7 +9,7 @@ module Longboat next unless Dir.exist?(dir) Dir.entries(dir).each do |file| - next unless file =~ /\A(?!:[^.]).*[^_].*\.rb\Z/ + next unless file =~ /\A(?![._])[a-zA-Z0-9]+(?:_[a-zA-Z0-9]+)*\.rb\Z/ reqname = File.basename(file, ".rb") cname = reqname.split('_').map(&:capitalize).join -- cgit v1.2.1