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.
165 166 167 168 |
# File 'lib/shared_infrastructure/nginx/builder.rb', line 165 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.
169 170 171 |
# File 'lib/shared_infrastructure/nginx/builder.rb', line 169 def rails_env @rails_env end |
Instance Method Details
#save ⇒ Object
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/shared_infrastructure/nginx/builder.rb', line 171 def save SharedInfrastructure::Output.open(File.join("/etc/logrotate.d", "#{domain.domain_name}.conf"), "w") do |io| io << " compress\n\n \#{domain.rails_env_log(rails_env)} {\n size 1M\n rotate 4\n copytruncate\n missingok\n notifempty\n }\n LOGROTATE\n end &&\n Systemd::Rails.write_unit_file(domain.domain_name, domain, rails_env, user) &&\n super\nend\n" |