Class: Nginx::Builder::Rails
- Defined in:
- lib/shared_infrastructure/nginx/builder.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#rails_env ⇒ Object
readonly
Returns the value of attribute rails_env.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(user, *server_blocks, domain: nil, rails_env: "production") ⇒ Rails
constructor
A new instance of Rails.
- #save ⇒ Object
Methods inherited from Site
Methods inherited from Base
#https_reminder_message, #to_s
Constructor Details
#initialize(user, *server_blocks, domain: nil, rails_env: "production") ⇒ Rails
Returns a new instance of Rails.
166 167 168 169 |
# File 'lib/shared_infrastructure/nginx/builder.rb', line 166 def initialize(user, *server_blocks, domain: nil, rails_env: "production") @rails_env = rails_env super user, *server_blocks, domain: domain end |
Instance Attribute Details
#rails_env ⇒ Object (readonly)
Returns the value of attribute rails_env.
170 171 172 |
# File 'lib/shared_infrastructure/nginx/builder.rb', line 170 def rails_env @rails_env end |
Instance Method Details
#save ⇒ Object
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/shared_infrastructure/nginx/builder.rb', line 172 def save SharedInfrastructure::Output.open(File.join("/etc/logrotate.d", "#{domain.domain_name}.conf"), "w") do |io| io << <<~LOGROTATE compress #{domain.rails_env_log(rails_env)} { size 1M rotate 4 copytruncate missingok notifempty } LOGROTATE end && Systemd::Rails.write_unit_file(domain.domain_name, domain, rails_env, user) && super end |