mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-17 05:46:23 +00:00
fix: simplificar
This commit is contained in:
parent
f076838be5
commit
a6195fbccc
3 changed files with 7 additions and 2 deletions
|
@ -22,7 +22,7 @@ class BuildStatsController < ApplicationController
|
||||||
|
|
||||||
@table = site.deployment_list.map do |deploy|
|
@table = site.deployment_list.map do |deploy|
|
||||||
type = deploy.class.name.underscore
|
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)
|
URI.parse(url)
|
||||||
rescue URI::Error
|
rescue URI::Error
|
||||||
nil
|
nil
|
||||||
|
|
|
@ -51,7 +51,7 @@ class DeployJob < ApplicationJob
|
||||||
status = d.deploy(output: @output)
|
status = d.deploy(output: @output)
|
||||||
seconds = d.build_stats.last.try(:seconds) || 0
|
seconds = d.build_stats.last.try(:seconds) || 0
|
||||||
size = d.size
|
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
|
URI.parse url
|
||||||
rescue URI::Error
|
rescue URI::Error
|
||||||
nil
|
nil
|
||||||
|
|
|
@ -23,6 +23,11 @@ class Deploy < ApplicationRecord
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @return [Array]
|
||||||
|
def urls
|
||||||
|
[url].compact
|
||||||
|
end
|
||||||
|
|
||||||
def limit
|
def limit
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue