Class: Quails::Command::ServerCommand

Inherits:
Base show all
Defined in:
railties/lib/rails/commands/server/server_command.rb

Overview

:nodoc:

Constant Summary collapse

DEFAULT_PORT =
3000
DEFAULT_PID_PATH =
"tmp/pids/server.pid".freeze

Instance Method Summary collapse

Methods inherited from Base

base_name, command_name, default_command_root, desc, engine?, executable, #help, hide_command!, inherited, namespace, perform, printing_commands, usage_path

Methods included from Actions

#load_generators, #load_tasks, #require_application_and_environment!, #set_application_directory!

Constructor Details

#initialize(args = [], local_options = {}, config = {}) ⇒ ServerCommand

Returns a new instance of ServerCommand.



131
132
133
134
135
136
# File 'railties/lib/rails/commands/server/server_command.rb', line 131

def initialize(args = [], local_options = {}, config = {})
  @original_options = local_options
  super
  @server = self.args.shift
  @log_stdout = options[:daemon].blank? && (options[:environment] || Quails.env) == "development"
end

Instance Method Details

#performObject



138
139
140
141
142
143
144
145
146
147
148
# File 'railties/lib/rails/commands/server/server_command.rb', line 138

def perform
  set_application_directory!
  prepare_restart
  Quails::Server.new(server_options).tap do |server|
    # Require application after server sets environment to propagate
    # the --environment option.
    require APP_PATH
    Dir.chdir(Quails.application.root)
    server.start
  end
end