summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-10-02 15:00:50 -0700
committerMichael Kozono <mkozono@gmail.com>2017-10-07 10:28:13 -0700
commit714f264d62c5d2a45efc4b013f2fca1eb7eff1f1 (patch)
tree486a77e17a856c5145dd99a5a40197bef097fd93
parenta6a764f73debb41005fbfe7e902c9f51e2bbcff1 (diff)
downloadgitlab-ce-714f264d62c5d2a45efc4b013f2fca1eb7eff1f1.tar.gz
Rename method to `to_normalized_s`
-rw-r--r--db/post_migrate/20170921101004_normalize_ldap_extern_uids.rb4
-rw-r--r--lib/gitlab/ldap/auth_hash.rb2
-rw-r--r--lib/gitlab/ldap/dn.rb2
-rw-r--r--lib/gitlab/ldap/person.rb2
-rw-r--r--spec/lib/gitlab/ldap/dn_spec.rb4
5 files changed, 7 insertions, 7 deletions
diff --git a/db/post_migrate/20170921101004_normalize_ldap_extern_uids.rb b/db/post_migrate/20170921101004_normalize_ldap_extern_uids.rb
index 501ba7c5fe2..aa95fa49e48 100644
--- a/db/post_migrate/20170921101004_normalize_ldap_extern_uids.rb
+++ b/db/post_migrate/20170921101004_normalize_ldap_extern_uids.rb
@@ -220,7 +220,7 @@ class NormalizeLdapExternUids < ActiveRecord::Migration
##
# Return the DN as an escaped and normalized string.
- def to_s_normalized
+ def to_normalized_s
self.class.new(*to_a).to_s
end
@@ -270,7 +270,7 @@ class NormalizeLdapExternUids < ActiveRecord::Migration
ldap_identities = Identity.where("provider like 'ldap%'")
ldap_identities.find_each do |identity|
begin
- identity.extern_uid = Gitlab::LDAP::DN.new(identity.extern_uid).to_s_normalized
+ identity.extern_uid = Gitlab::LDAP::DN.new(identity.extern_uid).to_normalized_s
unless identity.save
say "Unable to normalize \"#{identity.extern_uid}\". Skipping."
end
diff --git a/lib/gitlab/ldap/auth_hash.rb b/lib/gitlab/ldap/auth_hash.rb
index 2ea0a51b18f..b173b879f5f 100644
--- a/lib/gitlab/ldap/auth_hash.rb
+++ b/lib/gitlab/ldap/auth_hash.rb
@@ -4,7 +4,7 @@ module Gitlab
module LDAP
class AuthHash < Gitlab::OAuth::AuthHash
def uid
- Gitlab::LDAP::DN.new(super).to_s_normalized
+ Gitlab::LDAP::DN.new(super).to_normalized_s
end
private
diff --git a/lib/gitlab/ldap/dn.rb b/lib/gitlab/ldap/dn.rb
index 060f61d1a10..4ecb5566018 100644
--- a/lib/gitlab/ldap/dn.rb
+++ b/lib/gitlab/ldap/dn.rb
@@ -235,7 +235,7 @@ module Gitlab
##
# Return the DN as an escaped and normalized string.
- def to_s_normalized
+ def to_normalized_s
self.class.new(*to_a).to_s.downcase
end
diff --git a/lib/gitlab/ldap/person.rb b/lib/gitlab/ldap/person.rb
index 44cb6a065c9..af8aab2444b 100644
--- a/lib/gitlab/ldap/person.rb
+++ b/lib/gitlab/ldap/person.rb
@@ -72,7 +72,7 @@ module Gitlab
end
def dn
- DN.new(entry.dn).to_s_normalized
+ DN.new(entry.dn).to_normalized_s
end
private
diff --git a/spec/lib/gitlab/ldap/dn_spec.rb b/spec/lib/gitlab/ldap/dn_spec.rb
index 67a561854aa..9a1963e2194 100644
--- a/spec/lib/gitlab/ldap/dn_spec.rb
+++ b/spec/lib/gitlab/ldap/dn_spec.rb
@@ -3,8 +3,8 @@ require 'spec_helper'
describe Gitlab::LDAP::DN do
using RSpec::Parameterized::TableSyntax
- describe '#to_s_normalized' do
- subject { described_class.new(given).to_s_normalized }
+ describe '#to_normalized_s' do
+ subject { described_class.new(given).to_normalized_s }
# Regarding the telephoneNumber test:
#