Fix file detection in Ruby syntax check