5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-17 07:56:24 +00:00

fix: siempre devolver un array

This commit is contained in:
f 2023-04-15 19:13:23 -03:00
parent 5d541ebee6
commit 251dde865b

View file

@ -85,20 +85,22 @@ class DeployDistributedPress < Deploy
private
# @return [Array]
def gateway_urls
remote_info.dig(:distributed_press, :links).values.map do |protocol|
remote_info.dig(:distributed_press, :links)&.values&.map do |protocol|
[ protocol[:link], protocol[:gateway] ]
end.flatten.compact.select do |link|
end&.flatten&.compact&.select do |link|
link.include? '://'
end
end || []
end
# @return [Array]
def protocol_urls
remote_info.dig(:distributed_press, :protocols).select do |_, enabled|
remote_info.dig(:distributed_press, :protocols)&.select do |_, enabled|
enabled
end.map do |protocol, _|
end&.map do |protocol, _|
"#{protocol}://#{site.hostname}"
end
end || []
end
# El cliente de la API