1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-11-30 21:32:30 +00:00

style(rubocop): Style/IdenticalConditionalBranches

هذا الالتزام موجود في:
Adam Cooke
2024-02-10 23:06:51 +00:00
الأصل 6ad56ee9c9
التزام 6a58ecf605
3 ملفات معدلة مع 9 إضافات و15 حذوفات

عرض الملف

@@ -48,11 +48,7 @@ class ApplicationController < ActionController::Base
helper_method :page_title
def redirect_to_with_return_to(url, *args)
if params[:return_to].blank? || !params[:return_to].starts_with?("/")
redirect_to url_with_return_to(url), *args
else
redirect_to url_with_return_to(url), *args
end
redirect_to url_with_return_to(url), *args
end
def set_timezone

عرض الملف

@@ -159,13 +159,11 @@ module Postal
# The client is not negotiating a TLS handshake at this time
begin
# Read 10kiB of data at a time from the socket.
buffers[io] << io.readpartial(10_240)
# There is an extra step for SSL sockets
case io
when OpenSSL::SSL::SSLSocket
buffers[io] << io.readpartial(10_240)
if io.is_a?(OpenSSL::SSL::SSLSocket)
buffers[io] << io.readpartial(10_240) while io.pending.positive?
else
buffers[io] << io.readpartial(10_240)
end
rescue EOFError, Errno::ECONNRESET, Errno::ETIMEDOUT
# Client went away
@@ -280,12 +278,14 @@ module Postal
end
# If we have been spawned to replace an existing processm shut down the
# parent after listening.
# rubocop:disable Style/IdenticalConditionalBranches
if ENV["SERVER_FD"]
listen
kill_parent
kill_parent if ENV["SERVER_FD"]
else
listen
end
# rubocop:enable Style/IdenticalConditionalBranches
run_event_loop
end

عرض الملف

@@ -18,18 +18,16 @@ module Postal
user.password = cli.ask("Initial Password".ljust(20, " ") + ": ") { |value| value.echo = "*" }
block.call(user) if block_given?
puts
if user.save
puts
puts "User has been created with e-mail address \e[32m#{user.email_address}\e[0m"
puts
else
puts
puts "\e[31mFailed to create user\e[0m"
for error in user.errors.full_messages
puts " * #{error}"
end
puts
end
puts
end
end