mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 10:31:41 +00:00
feat: devolver las urls con protocolos
This commit is contained in:
parent
a56acfd6da
commit
ab126038af
1 changed files with 13 additions and 1 deletions
|
@ -80,6 +80,12 @@ class DeployDistributedPress < Deploy
|
|||
|
||||
# Devuelve las URLs de todos los protocolos
|
||||
def urls
|
||||
protocol_urls + gateway_urls
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def gateway_urls
|
||||
remote_info.dig(:distributed_press, :links).values.map do |protocol|
|
||||
[ protocol[:link], protocol[:gateway] ]
|
||||
end.flatten.compact.select do |link|
|
||||
|
@ -87,7 +93,13 @@ class DeployDistributedPress < Deploy
|
|||
end
|
||||
end
|
||||
|
||||
private
|
||||
def protocol_urls
|
||||
remote_info.dig(:distributed_press, :protocols).select do |_, enabled|
|
||||
enabled
|
||||
end.map do |protocol, _|
|
||||
"#{protocol}://#{site.hostname}"
|
||||
end
|
||||
end
|
||||
|
||||
# El cliente de la API
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue