5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-05-19 03:40:48 +00:00

fix: simplificar

This commit is contained in:
f 2023-08-31 14:52:49 -03:00
parent f076838be5
commit a6195fbccc
No known key found for this signature in database
3 changed files with 7 additions and 2 deletions

View file

@ -22,7 +22,7 @@ class BuildStatsController < ApplicationController
@table = site.deployment_list.map do |deploy|
type = deploy.class.name.underscore
urls = (deploy.respond_to?(:urls) ? deploy.urls : [deploy.url].compact).map do |url|
urls = deploy.urls.map do |url|
URI.parse(url)
rescue URI::Error
nil

View file

@ -51,7 +51,7 @@ class DeployJob < ApplicationJob
status = d.deploy(output: @output)
seconds = d.build_stats.last.try(:seconds) || 0
size = d.size
urls = (d.respond_to?(:urls) ? d.urls : [d.url].compact).map do |url|
urls = d.urls.map do |url|
URI.parse url
rescue URI::Error
nil

View file

@ -23,6 +23,11 @@ class Deploy < ApplicationRecord
raise NotImplementedError
end
# @return [Array]
def urls
[url].compact
end
def limit
raise NotImplementedError
end