方法
- B
- L
- R
- S
实例公共方法
boot_application!() 链接
来源:显示 | 在 GitHub 上
# File railties/lib/rails/command/actions.rb, line 18 def boot_application! require_application! Rails.application.require_environment! if defined?(APP_PATH) end
load_environment_config!() 链接
来源:显示 | 在 GitHub 上
# File railties/lib/rails/command/actions.rb, line 23 def load_environment_config! require_application! # Only run initializers that are in the :all group, which includes the # :load_environment_config initializer. Rails.application.initialize!(:_) if defined?(APP_PATH) end
load_generators() 链接
来源:显示 | 在 GitHub 上
# File railties/lib/rails/command/actions.rb, line 36 def load_generators engine = ::Rails::Engine.find(ENGINE_ROOT) Rails::Generators.namespace = engine.railtie_namespace engine.load_generators end
load_tasks() 链接
来源:显示 | 在 GitHub 上
# File railties/lib/rails/command/actions.rb, line 31 def load_tasks Rake.application.init("rails") Rake.application.load_rakefile end
require_application!() 链接
来源:显示 | 在 GitHub 上
# File railties/lib/rails/command/actions.rb, line 13 def require_application! require ENGINE_PATH if defined?(ENGINE_PATH) require APP_PATH if defined?(APP_PATH) end
set_application_directory!() 链接
如果当前目录中没有 config.ru
文件,则更改为应用程序的路径。这允许我们从其他目录运行 rails server
,但仍然获取主 config.ru
并正确设置 tmp
目录。
来源:显示 | 在 GitHub 上
# File railties/lib/rails/command/actions.rb, line 9 def set_application_directory! Dir.chdir(File.expand_path("../..", APP_PATH)) unless File.exist?(File.expand_path("config.ru")) end