2016年4月10日 星期日

Rails 啟動過程

1 啟動!
  1. call ruby rails in RVM folder => railties/bin/rails => require "rails/cli"
  2. railties/lib/rails/app_rails_loader.rb : find ‘bin/rails’
  3. bin/rails: require_relative '../config/boot and require 'rails/commands'
  4. config/boot.rb: setting Bundler, Gemfile
  5. rails/commands.rb: setting aliases, require 'rails/commands/commands_tasks'
  6. rails/commands/command_tasks.rb: run command, => rails/commands/server => require ‘fileutils, ‘optparse', ‘action_dispatch’, require 'rails'
  7. actionpack/lib/action_dispatch.rb: response routes
  8. rails/commands/server.rb: inherited from Rack::Server: call Rack::Server’s initialize。
  9. Rack: lib/rack/server.rb: provide interface for app on rack base, => setting options
  10. config/application.rb: app settings
  11. Rails::Server#start: still will call Rack::Server.start
  12. config/environment.rb
  13. config/application.rb => require ‘rails/all'

2 載入 Rails

  1. railties/lib/rails/all.rb
  2. config/environment.rb
  3. railties/lib/rails/application.rb: initialize!
  4. Rack: lib/rack/server.rb

沒有留言:

張貼留言