gitlab-org--gitlab-foss/app/controllers/projects/badges_controller.rb
gfyoung 12ee2753c1 Enable even more frozen string in app/controllers
Enables frozen string for some vestigial files as
well as the following:

* app/controllers/projects/**/*.rb
* app/controllers/sherlock/**/*.rb
* app/controllers/snippets/**/*.rb
* app/controllers/users/**/*.rb

Partially addresses #47424.
2018-09-25 22:43:49 -07:00

32 lines
742 B
Ruby

# frozen_string_literal: true
class Projects::BadgesController < Projects::ApplicationController
layout 'project_settings'
before_action :authorize_admin_project!, only: [:index]
before_action :no_cache_headers, except: [:index]
def pipeline
pipeline_status = Gitlab::Badge::Pipeline::Status
.new(project, params[:ref])
render_badge pipeline_status
end
def coverage
coverage_report = Gitlab::Badge::Coverage::Report
.new(project, params[:ref], params[:job])
render_badge coverage_report
end
private
def render_badge(badge)
respond_to do |format|
format.html { render_404 }
format.svg do
render 'badge', locals: { badge: badge.template }
end
end
end
end