diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-12-14 14:54:59 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-01-09 10:07:48 +0900 |
commit | 2a5c116f12c7716399f5da3fe788f7e23ae67c4c (patch) | |
tree | 6befeb4de59a0a62bb21b0d64ae11e3b287e0b66 /railties/lib/rails/commands/server | |
parent | 7f19f30819dd5a5a788ad9d8b12b5dda76559a12 (diff) | |
download | rails-2a5c116f12c7716399f5da3fe788f7e23ae67c4c.tar.gz rails-2a5c116f12c7716399f5da3fe788f7e23ae67c4c.tar.bz2 rails-2a5c116f12c7716399f5da3fe788f7e23ae67c4c.zip |
make all rails commands work in engine
Currently, all rails commands can be executed in engine,
but `server`, `console`, `dbconsole` and `runner` do not work.
This make all rails commands work in engine.
Related to #22588
Diffstat (limited to 'railties/lib/rails/commands/server')
-rw-r--r-- | railties/lib/rails/commands/server/server_command.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/railties/lib/rails/commands/server/server_command.rb b/railties/lib/rails/commands/server/server_command.rb index 15c636103b..d58721f648 100644 --- a/railties/lib/rails/commands/server/server_command.rb +++ b/railties/lib/rails/commands/server/server_command.rb @@ -95,7 +95,7 @@ module Rails module Command class ServerCommand < Base # :nodoc: - DEFAULT_PID_PATH = File.expand_path("tmp/pids/server.pid").freeze + DEFAULT_PID_PATH = "tmp/pids/server.pid".freeze class_option :port, aliases: "-p", type: :numeric, desc: "Runs Rails on the specified port.", banner: :port, default: 3000 @@ -141,7 +141,7 @@ module Rails config: options[:config], environment: environment, daemonize: options[:daemon], - pid: options[:pid], + pid: pid, caching: options["dev-caching"], restart_cmd: restart_command } @@ -165,6 +165,10 @@ module Rails "bin/rails server #{@server} #{@original_options.join(" ")}" end + def pid + File.expand_path(options[:pid]) + end + def self.banner(*) "rails server [puma, thin etc] [options]" end |