5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-10-04 21:56:57 +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 private
# @return [Array]
def gateway_urls 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] ] [ protocol[:link], protocol[:gateway] ]
end.flatten.compact.select do |link| end&.flatten&.compact&.select do |link|
link.include? '://' link.include? '://'
end end || []
end end
# @return [Array]
def protocol_urls def protocol_urls
remote_info.dig(:distributed_press, :protocols).select do |_, enabled| remote_info.dig(:distributed_press, :protocols)&.select do |_, enabled|
enabled enabled
end.map do |protocol, _| end&.map do |protocol, _|
"#{protocol}://#{site.hostname}" "#{protocol}://#{site.hostname}"
end end || []
end end
# El cliente de la API # El cliente de la API