Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgfyoung <gfyoung17@gmail.com>2018-08-18 14:19:57 +0300
committergfyoung <gfyoung17@gmail.com>2018-09-07 03:33:46 +0300
commit1993a4449a5be44acfa5a9e1a94842e05da5edd5 (patch)
tree80a38bd0b427a5baf7ca36a3a71f8eb75c9d912f /app/helpers/projects_helper.rb
parent07d5ee361a438fcfff28fe184bbec2aa98ce5d14 (diff)
Enable frozen string for app/helpers/**/*.rb
Partially addresses #47424.
Diffstat (limited to 'app/helpers/projects_helper.rb')
-rw-r--r--app/helpers/projects_helper.rb17
1 files changed, 6 insertions, 11 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 7a9b63d8852..89fee06ee77 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ProjectsHelper
def link_to_project(project)
link_to [project.namespace.becomes(Namespace), project], title: h(project.name) do
@@ -50,7 +52,7 @@ module ProjectsHelper
return "(deleted)" unless author
- author_html = ""
+ author_html = []
# Build avatar image tag
author_html << link_to_member_avatar(author, opts) if opts[:avatar]
@@ -60,7 +62,7 @@ module ProjectsHelper
author_html << capture(&block) if block
- author_html = author_html.html_safe
+ author_html = author_html.join.html_safe
if opts[:name]
link_to(author_html, user_path(author), class: "author-link #{"#{opts[:extra_class]}" if opts[:extra_class]} #{"#{opts[:mobile_classes]}" if opts[:mobile_classes]}").html_safe
@@ -80,15 +82,8 @@ module ProjectsHelper
end
project_link = link_to project_path(project) do
- output =
- if project.avatar_url && !Rails.env.test?
- project_icon(project, alt: project.name, class: 'avatar-tile', width: 15, height: 15)
- else
- ""
- end
-
- output << content_tag("span", simple_sanitize(project.name), class: "breadcrumb-item-text js-breadcrumb-item-text")
- output.html_safe
+ icon = project_icon(project, alt: project.name, class: 'avatar-tile', width: 15, height: 15) if project.avatar_url && !Rails.env.test?
+ [icon, content_tag("span", simple_sanitize(project.name), class: "breadcrumb-item-text js-breadcrumb-item-text")].join.html_safe
end
namespace_link = breadcrumb_list_item(namespace_link) unless project.group