Class: Hanami::Reloader::Commands::Server
- Inherits:
-
CLI::Commands::App::Server
- Object
- CLI::Commands::App::Server
- Hanami::Reloader::Commands::Server
- Defined in:
- lib/hanami/reloader/commands.rb
Overview
Override ‘hanami server` command
Constant Summary collapse
- DEFAULT_GUARD_PUMA_OPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
["-n", "f", "-i", "-g", Guardfile.group, "-G"].freeze
- OPTIONS_SEPARATOR =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
" "
Instance Method Summary collapse
Instance Method Details
#call(**args) ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/hanami/reloader/commands.rb', line 78 def call(**args) code_reloading = args.fetch(:code_reloading) if ENV["HANAMI_ENV"] == "production" msg = <<~TEXT WARNING: You are running `hanami server` in the production environment via hanami-reloader. Code reloading is disabled, but `hanami server` and hanami-reloader are intended to be used in development only. For production, start your web server directly, e.g. `bundle exec puma -C config/puma.rb`. TEXT err.puts msg return super end if code_reloading guard_puma_env_vars!(**args) exec "bundle exec guard #{(**args)}" else super end end |