Skip to content

Commit

Permalink
Merge pull request #30331 from yhirano55/update_rails_initialization_…
Browse files Browse the repository at this point in the history
…process_guide

Update The Rails Initialization Process of guide [ci skip]
  • Loading branch information
georgeclaghorn committed Aug 20, 2017
2 parents ba282f0 + 0027629 commit 770149b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions guides/source/initialization.md
Expand Up @@ -99,13 +99,15 @@ configure the load path for your Gemfile's dependencies.

A standard Rails application depends on several gems, specifically:

* actioncable
* actionmailer
* actionpack
* actionview
* activejob
* activemodel
* activerecord
* activestorage
* activesupport
* activejob
* arel
* builder
* bundler
Expand All @@ -131,7 +133,7 @@ Once `config/boot.rb` has finished, the next file that is required is
`ARGV` array simply contains `server` which will be passed over:

```ruby
require "rails/command"
require_relative "command"

aliases = {
"g" => "generate",
Expand Down Expand Up @@ -170,7 +172,7 @@ module Rails::Command
namespace = namespace.to_s
namespace = "help" if namespace.blank? || HELP_MAPPINGS.include?(namespace)
namespace = "version" if %w( -v --version ).include? namespace

if command = find_by_namespace(namespace)
command.perform(namespace, args, config)
else
Expand All @@ -189,7 +191,7 @@ module Rails
class ServerCommand < Base # :nodoc:
def perform
set_application_directory!

Rails::Server.new.tap do |server|
# Require application after server sets environment to propagate
# the --environment option.
Expand Down Expand Up @@ -311,7 +313,7 @@ def parse!(args)
args, options = args.dup, {}

option_parser(options).parse! args

options[:log_stdout] = options[:daemonize].blank? && (options[:environment] || Rails.env) == "development"
options[:server] = args.shift
options
Expand Down Expand Up @@ -366,11 +368,11 @@ private

def log_to_stdout
wrapped_app # touch the app so the logger is set up

console = ActiveSupport::Logger.new(STDOUT)
console.formatter = Rails.logger.formatter
console.level = Rails.logger.level

unless ActiveSupport::Logger.logger_outputs_to?(Rails.logger, STDOUT)
Rails.logger.extend(ActiveSupport::Logger.broadcast(console))
end
Expand Down Expand Up @@ -537,6 +539,7 @@ require "rails"
action_mailer/railtie
active_job/railtie
action_cable/engine
active_storage/engine
rails/test_unit/railtie
sprockets/railtie
).each do |railtie|
Expand Down

0 comments on commit 770149b

Please sign in to comment.