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:
parent
5d541ebee6
commit
251dde865b
1 changed files with 8 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue