Jonathan's clever and cunning approach is great, capable of slashing through hordes of symlinks with but a mere flick of a few asterisks, muahaha. However, it has the unfortunate side-effect of not returning immediate-child matches. An improved version might be:
Dir.glob("**{,/*/**}/*.rb")
Which will (in my tests) do both follow one symlink and return immediate children.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…