Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在方法缺少调用的rails源中找到它:
https://github.com/rails/rails/blob/57cfa7a98fee14c7b61f5d4930ca05ae262e9a91/railties/lib/rails/railtie/configuration.rb
它有什么作用?
=只是文字“=”
=
$是一个正则表达式元字符,一个匹配行尾的锚点
$
/=$/因此,当一行中的最后一个字符是“=”时,正则表达式为真。
/=$/
您可以在 rubular.com 上测试您的 ruby 正则表达式。看你的!
它将检查字符串是否以等号结尾。