Refactor builds badge, encapsulate inside a class
This merge requests attempts to introduce interface for all badges. Currently we only have a build badge, but other badges are in plans, like coverage badge. Encapsulating this inside class and creating an abstraction has some benefits:
- It will be easier to implement new badges
- It will be easier to create badges that will use SVG template, and
Nokogiri::XML
to modify content (like coverage badge) - It will be easier to test badges, and write unit tests for badges
- It will be easier to refactor badges (like to remove
Ci::ImageForBuildService
and replace with svg templates) - It will be easier to remove badges from assets, leaving just one template for SVG (we currently have svg images for each build badge, like
build-success.svg
andbuild-unknown.svg
etc) - It will be easier to remove unused helpers (
CiBadgeHelper
) - It will be easier to reuse badges
/cc @ayufan @DouweM @rspeicher