1 啟動!
- call ruby rails in RVM folder => railties/bin/rails => require "rails/cli"
- railties/lib/rails/app_rails_loader.rb : find ‘bin/rails’
- bin/rails: require_relative '../config/boot and require 'rails/commands'
- config/boot.rb: setting Bundler, Gemfile
- rails/commands.rb: setting aliases, require 'rails/commands/commands_tasks'
- rails/commands/command_tasks.rb: run command, => rails/commands/server => require ‘fileutils, ‘optparse', ‘action_dispatch’, require 'rails'
- actionpack/lib/action_dispatch.rb: response routes
- rails/commands/server.rb: inherited from Rack::Server: call Rack::Server’s initialize。
- Rack: lib/rack/server.rb: provide interface for app on rack base, => setting options
- config/application.rb: app settings
- Rails::Server#start: still will call Rack::Server.start
- config/environment.rb
- config/application.rb => require ‘rails/all'
2 載入 Rails
- railties/lib/rails/all.rb
- config/environment.rb
- railties/lib/rails/application.rb: initialize!
- Rack: lib/rack/server.rb
沒有留言:
張貼留言