Commit f962745c authored by Yorick Peterse's avatar Yorick Peterse

Use tr/casecmp to keep Rubocop happy

parent 81965c7f
......@@ -258,7 +258,7 @@ module Gitlab
return build_status_object(false, "Author '#{commit.author_email}' is not a member of team")
end
if commit.author_email.downcase != commit.committer_email.downcase
if commit.author_email.casecmp(commit.committer_email) == -1
unless User.existing_member?(commit.committer_email.downcase)
return build_status_object(false, "Committer '#{commit.committer_email}' is not a member of team")
end
......
......@@ -103,7 +103,7 @@ module Gitlab
verified_admin_users << user
else
logger.debug do
<<-MSG.strip_heredoc.gsub(/\n/, ' ')
<<-MSG.strip_heredoc.tr("\n", ' ')
#{self.class.name}: User with DN `#{member_dn}` should have admin
access but there is no user in GitLab with that identity.
Membership will be updated once the user signs in for the first time.
......@@ -277,7 +277,7 @@ module Gitlab
add_or_update_user_membership(user, group, access_level)
else
logger.debug do
<<-MSG.strip_heredoc.gsub(/\n/, ' ')
<<-MSG.strip_heredoc.tr("\n", ' ')
#{self.class.name}: User with DN `#{member_dn}` should have access
to '#{group.name}' group but there is no user in GitLab with that
identity. Membership will be updated once the user signs in for
......@@ -301,7 +301,7 @@ module Gitlab
def warn_cannot_remove_last_owner(user, group)
logger.warn do
<<-MSG.strip_heredoc.gsub(/\n/, ' ')
<<-MSG.strip_heredoc.tr("\n", ' ')
#{self.class.name}: LDAP group sync cannot remove #{user.name}
(#{user.id}) from group #{group.name} (#{group.id}) as this is
the group's last owner
......
......@@ -70,7 +70,7 @@ module Gitlab
Net::LDAP::DN.new(dn).each_pair { |name, value| dn_components << { name: name, value: value } }
dn_components.
reverse.
take_while { |rdn| rdn[:name].upcase=='DC' }. # Domain Component
take_while { |rdn| rdn[:name].casecmp('DC') == 0 }. # Domain Component
map { |rdn| rdn[:value] }.
reverse.
join('.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment