From 8a4d68c53e9c58ad7f8dce1494f7976292b2f929 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 21 Feb 2017 19:02:23 -0600 Subject: Enable Style/ConditionalAssignment --- lib/banzai/filter/abstract_reference_filter.rb | 6 +++--- lib/banzai/filter/gollum_tags_filter.rb | 6 +++--- lib/banzai/filter/issue_reference_filter.rb | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/banzai') 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| -- cgit v1.2.1