提交 835c3e80 编写于 作者: X Xavier Noria

remove spurious trailing commas from zeitwerk:check error messages

Since the original message is something like this

    expected file ... to define constant A, but didn't

the \S+ captured the comma. A constant name goes there, so [\w:]+ is
enough and won't match the comma.
上级 c82c2fef
......@@ -46,7 +46,7 @@ namespace :zeitwerk do
begin
eager_load[]
rescue NameError => e
if e.message =~ /expected file .*? to define constant \S+/
if e.message =~ /expected file .*? to define constant [\w:]+/
abort $&.sub(/expected file #{Regexp.escape(Rails.root.to_s)}./, "expected file ")
else
raise
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册