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