gitlab-org--gitlab-foss/app/helpers/graph_helper.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
718 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module GraphHelper
def refs(repo, commit)
refs = [commit.ref_names(repo).join(' ')]
2013-03-26 00:51:39 +00:00
# append note count
notes_count = @graph.notes[commit.id]
refs << "[#{pluralize(notes_count, 'note')}]" if notes_count > 0
2013-03-26 00:51:39 +00:00
refs.join
end
def parents_zip_spaces(parents, parent_spaces)
ids = parents.map { |p| p.id }
ids.zip(parent_spaces)
end
2015-12-04 11:55:23 +00:00
def success_ratio(counts)
return 100 if counts[:failed] == 0
2015-12-04 11:55:23 +00:00
ratio = (counts[:success].to_f / (counts[:success] + counts[:failed])) * 100
2015-12-04 11:55:23 +00:00
ratio.to_i
end
def should_render_dora_charts
false
end
def should_render_quality_summary
false
end
end
GraphHelper.prepend_mod_with('GraphHelper')