rails 命令行(如 new、generate)的源代码在哪里?

Where is the source for rails command line like new, generate located?

我想知道我们什么时候 运行 命令像 rails new,rails 生成。实际执行了哪些文件。一般来说,对于其他工具,如 rake,rspec(不确定它们是否称为命令行工具)或任何其他此类 gem,首先执行哪些文件(在开头)。 谢谢

其中大部分位于此文件夹中 https://github.com/rails/rails/tree/3be590edbedab8ddcacdf72790d50c3cf9354434/railties/lib/rails/commands

比如这个https://github.com/rails/rails/blob/3be590edbedab8ddcacdf72790d50c3cf9354434/railties/lib/rails/commands/application/application_command.rb calls the app generator https://github.com/rails/rails/blob/3be590edbedab8ddcacdf72790d50c3cf9354434/railties/lib/rails/generators/rails/app/app_generator.rb