mirror of
https://0xacab.org/sutty/sutty
synced 2025-01-19 14:13:38 +00:00
fix: siempre devolver un array
This commit is contained in:
parent
5d541ebee6
commit
251dde865b
1 changed files with 8 additions and 6 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue