Class: NginxStage::AppConfigGenerator
- Includes:
- AppConfigView
- Defined in:
- lib/nginx_stage/generators/app_config_generator.rb
Overview
This generator stages and generates the NGINX app config. It is also responsible for reloading the per-user NGINX process after updating the app config.
Instance Attribute Summary collapse
-
#env ⇒ Symbol
The environment the app is run under (parsed from sub_request).
-
#name ⇒ String
The name of the app.
-
#owner ⇒ String
The owner of the app (parsed from sub_request or assume it is user).
Instance Method Summary collapse
-
#sub_request ⇒ String
The remainder of the request after the sub-uri used to determine the environment and app.
Methods included from AppConfigView
#app_passenger_env, #app_request_uri, #app_root, #app_token, #sendfile_root, #sendfile_uri
Methods inherited from Generator
_options, add_hook, add_option, #create_file, desc, #empty_directory, footer, hooks, #initialize, #invoke, options, rem_hook, rem_option, #template
Methods included from GeneratorHelpers
#add_skip_nginx_support, #add_sub_uri_support, #add_user_support
Constructor Details
This class inherits a constructor from NginxStage::Generator
Instance Attribute Details
#env ⇒ Symbol
The environment the app is run under (parsed from sub_request)
26 27 28 |
# File 'lib/nginx_stage/generators/app_config_generator.rb', line 26 def env @env end |
#name ⇒ String
The name of the app
34 35 36 |
# File 'lib/nginx_stage/generators/app_config_generator.rb', line 34 def name @name end |
#owner ⇒ String
The owner of the app (parsed from sub_request or assume it is user)
30 31 32 |
# File 'lib/nginx_stage/generators/app_config_generator.rb', line 30 def owner @owner end |
Instance Method Details
#sub_request ⇒ String
The remainder of the request after the sub-uri used to determine the environment and app
52 53 54 55 56 57 58 |
# File 'lib/nginx_stage/generators/app_config_generator.rb', line 52 add_option :sub_request do { opt_args: ["-r", "--sub-request=SUB_REQUEST", "# The SUB_REQUEST that requests the specified app"], required: true # sub-request is validated in `NginxStage::parse_app_request` } end |