Rubocop fix: Perfomance/UnfreezeString
(#26217)
This commit is contained in:
parent
4d1b67f664
commit
30f5ec7303
6 changed files with 33 additions and 18 deletions
|
@ -438,12 +438,7 @@ namespace :mastodon do
|
|||
"#{key}=#{escaped}"
|
||||
end.join("\n")
|
||||
|
||||
generated_header = "# Generated with mastodon:setup on #{Time.now.utc}\n\n".dup
|
||||
|
||||
if incompatible_syntax
|
||||
generated_header << "# Some variables in this file will be interpreted differently whether you are\n"
|
||||
generated_header << "# using docker-compose or not.\n\n"
|
||||
end
|
||||
generated_header = generate_header(incompatible_syntax)
|
||||
|
||||
Rails.root.join('.env.production').write("#{generated_header}#{env_contents}\n")
|
||||
|
||||
|
@ -538,6 +533,19 @@ namespace :mastodon do
|
|||
puts "VAPID_PUBLIC_KEY=#{vapid_key.public_key}"
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def generate_header(include_warning)
|
||||
default_message = "# Generated with mastodon:setup on #{Time.now.utc}\n\n"
|
||||
|
||||
default_message.tap do |string|
|
||||
if include_warning
|
||||
string << "# Some variables in this file will be interpreted differently whether you are\n"
|
||||
string << "# using docker-compose or not.\n\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def disable_log_stdout!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue