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 = " WARNING: You are running `hanami server` in the production environment via hanami-reloader.\n\n Code reloading is disabled, but `hanami server` and hanami-reloader are intended to be used in\n development only.\n\n For production, start your web server directly, e.g. `bundle exec puma -C config/puma.rb`.\n TEXT\n\n err.puts msg\n\n return super\n end\n\n if code_reloading\n guard_puma_env_vars!(**args)\n exec \"bundle exec guard \#{guard_puma_options(**args)}\"\n else\n super\n end\nend\n" |