diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-21 19:02:23 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 09:31:57 -0600 |
commit | 8a4d68c53e9c58ad7f8dce1494f7976292b2f929 (patch) | |
tree | 773814f7079c626cafabc229f929cafbe4d4b2e7 /lib/banzai | |
parent | 7ea641b6d0882fc782a7eb493daf8b66d076924b (diff) | |
download | gitlab-ce-8a4d68c53e9c58ad7f8dce1494f7976292b2f929.tar.gz |
Enable Style/ConditionalAssignment
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/abstract_reference_filter.rb | 6 | ||||
-rw-r--r-- | lib/banzai/filter/gollum_tags_filter.rb | 6 | ||||
-rw-r--r-- | lib/banzai/filter/issue_reference_filter.rb | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/banzai/filter/abstract_reference_filter.rb b/lib/banzai/filter/abstract_reference_filter.rb index 3b15ff6566f..1c42ae3363d 100644 --- a/lib/banzai/filter/abstract_reference_filter.rb +++ b/lib/banzai/filter/abstract_reference_filter.rb @@ -160,10 +160,10 @@ module Banzai data = data_attributes_for(link_content || match, project, object, link: !!link_content) - if matches.names.include?("url") && matches[:url] - url = matches[:url] + url = if matches.names.include?("url") && matches[:url] + matches[:url] else - url = url_for_object_cached(object, project) + url_for_object_cached(object, project) end content = link_content || object_link_text(object, matches) diff --git a/lib/banzai/filter/gollum_tags_filter.rb b/lib/banzai/filter/gollum_tags_filter.rb index d08267a9d6c..35d21733967 100644 --- a/lib/banzai/filter/gollum_tags_filter.rb +++ b/lib/banzai/filter/gollum_tags_filter.rb @@ -149,10 +149,10 @@ module Banzai name, reference = *parts.compact.map(&:strip) end - if url?(reference) - href = reference + href = if url?(reference) + reference else - href = ::File.join(project_wiki_base_path, reference) + ::File.join(project_wiki_base_path, reference) end content_tag(:a, name || reference, href: href, class: 'gfm') diff --git a/lib/banzai/filter/issue_reference_filter.rb b/lib/banzai/filter/issue_reference_filter.rb index fd6b9704132..e5082895e82 100644 --- a/lib/banzai/filter/issue_reference_filter.rb +++ b/lib/banzai/filter/issue_reference_filter.rb @@ -39,10 +39,10 @@ module Banzai projects_per_reference.each do |path, project| issue_ids = references_per_project[path] - if project.default_issues_tracker? - issues = project.issues.where(iid: issue_ids.to_a) + issues = if project.default_issues_tracker? + project.issues.where(iid: issue_ids.to_a) else - issues = issue_ids.map { |id| ExternalIssue.new(id, project) } + issue_ids.map { |id| ExternalIssue.new(id, project) } end issues.each do |issue| |