use Repository::StatusImage
This commit is contained in:
parent
4ddec4a351
commit
6d12070fba
|
@ -1,7 +1,5 @@
|
||||||
module Travis::Api::App::Responders
|
module Travis::Api::App::Responders
|
||||||
class Image < Base
|
class Image < Base
|
||||||
NAMES = { nil => 'unknown', 0 => 'passing', 1 => 'failing' }
|
|
||||||
|
|
||||||
def apply?
|
def apply?
|
||||||
options[:format] == 'png'
|
options[:format] == 'png'
|
||||||
end
|
end
|
||||||
|
@ -18,7 +16,7 @@ module Travis::Api::App::Responders
|
||||||
end
|
end
|
||||||
|
|
||||||
def result
|
def result
|
||||||
NAMES[resource.try(:last_build_result_on, branch: params[:branch])]
|
Repository::StatusImage.new(resource, params[:branch]).result
|
||||||
end
|
end
|
||||||
|
|
||||||
def root
|
def root
|
||||||
|
|
Loading…
Reference in New Issue
Block a user