مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-12-01 05:43:04 +00:00
style(rubocop): Style/IdenticalConditionalBranches
هذا الالتزام موجود في:
@@ -48,11 +48,7 @@ class ApplicationController < ActionController::Base
|
|||||||
helper_method :page_title
|
helper_method :page_title
|
||||||
|
|
||||||
def redirect_to_with_return_to(url, *args)
|
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
|
||||||
redirect_to url_with_return_to(url), *args
|
|
||||||
else
|
|
||||||
redirect_to url_with_return_to(url), *args
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_timezone
|
def set_timezone
|
||||||
|
|||||||
@@ -159,13 +159,11 @@ module Postal
|
|||||||
# The client is not negotiating a TLS handshake at this time
|
# The client is not negotiating a TLS handshake at this time
|
||||||
begin
|
begin
|
||||||
# Read 10kiB of data at a time from the socket.
|
# Read 10kiB of data at a time from the socket.
|
||||||
|
buffers[io] << io.readpartial(10_240)
|
||||||
|
|
||||||
# There is an extra step for SSL sockets
|
# There is an extra step for SSL sockets
|
||||||
case io
|
if io.is_a?(OpenSSL::SSL::SSLSocket)
|
||||||
when OpenSSL::SSL::SSLSocket
|
|
||||||
buffers[io] << io.readpartial(10_240)
|
|
||||||
buffers[io] << io.readpartial(10_240) while io.pending.positive?
|
buffers[io] << io.readpartial(10_240) while io.pending.positive?
|
||||||
else
|
|
||||||
buffers[io] << io.readpartial(10_240)
|
|
||||||
end
|
end
|
||||||
rescue EOFError, Errno::ECONNRESET, Errno::ETIMEDOUT
|
rescue EOFError, Errno::ECONNRESET, Errno::ETIMEDOUT
|
||||||
# Client went away
|
# Client went away
|
||||||
@@ -280,12 +278,14 @@ module Postal
|
|||||||
end
|
end
|
||||||
# If we have been spawned to replace an existing processm shut down the
|
# If we have been spawned to replace an existing processm shut down the
|
||||||
# parent after listening.
|
# parent after listening.
|
||||||
|
# rubocop:disable Style/IdenticalConditionalBranches
|
||||||
if ENV["SERVER_FD"]
|
if ENV["SERVER_FD"]
|
||||||
listen
|
listen
|
||||||
kill_parent
|
kill_parent if ENV["SERVER_FD"]
|
||||||
else
|
else
|
||||||
listen
|
listen
|
||||||
end
|
end
|
||||||
|
# rubocop:enable Style/IdenticalConditionalBranches
|
||||||
run_event_loop
|
run_event_loop
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -18,18 +18,16 @@ module Postal
|
|||||||
user.password = cli.ask("Initial Password".ljust(20, " ") + ": ") { |value| value.echo = "*" }
|
user.password = cli.ask("Initial Password".ljust(20, " ") + ": ") { |value| value.echo = "*" }
|
||||||
|
|
||||||
block.call(user) if block_given?
|
block.call(user) if block_given?
|
||||||
|
puts
|
||||||
if user.save
|
if user.save
|
||||||
puts
|
|
||||||
puts "User has been created with e-mail address \e[32m#{user.email_address}\e[0m"
|
puts "User has been created with e-mail address \e[32m#{user.email_address}\e[0m"
|
||||||
puts
|
|
||||||
else
|
else
|
||||||
puts
|
|
||||||
puts "\e[31mFailed to create user\e[0m"
|
puts "\e[31mFailed to create user\e[0m"
|
||||||
for error in user.errors.full_messages
|
for error in user.errors.full_messages
|
||||||
puts " * #{error}"
|
puts " * #{error}"
|
||||||
end
|
end
|
||||||
puts
|
|
||||||
end
|
end
|
||||||
|
puts
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم