Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ac578436
Commit
ac578436
authored
Oct 06, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sync up hard coded DN class in migration
parent
2df7d035
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
20 deletions
+28
-20
lib/gitlab/background_migration/normalize_ldap_extern_uids_range.rb
.../background_migration/normalize_ldap_extern_uids_range.rb
+28
-20
No files found.
lib/gitlab/background_migration/normalize_ldap_extern_uids_range.rb
View file @
ac578436
...
@@ -37,26 +37,6 @@ module Gitlab
...
@@ -37,26 +37,6 @@ module Gitlab
end
end
end
end
def
initialize_array
(
args
)
buffer
=
StringIO
.
new
args
.
each_with_index
do
|
arg
,
index
|
if
index
.
even?
# key
buffer
<<
","
if
index
>
0
buffer
<<
arg
else
# value
buffer
<<
"="
buffer
<<
self
.
class
.
escape
(
arg
)
end
end
@dn
=
buffer
.
string
end
def
initialize_string
(
arg
)
@dn
=
arg
.
to_s
end
##
##
# Parse a DN into key value pairs using ASN from
# Parse a DN into key value pairs using ASN from
# http://tools.ietf.org/html/rfc2253 section 3.
# http://tools.ietf.org/html/rfc2253 section 3.
...
@@ -270,6 +250,28 @@ module Gitlab
...
@@ -270,6 +250,28 @@ module Gitlab
escaped
.
gsub
(
HEX_ESCAPE_RE
)
{
|
char
|
HEX_ESCAPES
[
char
]
}
escaped
.
gsub
(
HEX_ESCAPE_RE
)
{
|
char
|
HEX_ESCAPES
[
char
]
}
end
end
private
def
initialize_array
(
args
)
buffer
=
StringIO
.
new
args
.
each_with_index
do
|
arg
,
index
|
if
index
.
even?
# key
buffer
<<
","
if
index
>
0
buffer
<<
arg
else
# value
buffer
<<
"="
buffer
<<
self
.
class
.
escape
(
arg
)
end
end
@dn
=
buffer
.
string
end
def
initialize_string
(
arg
)
@dn
=
arg
.
to_s
end
##
##
# Proxy all other requests to the string object, because a DN is mainly
# Proxy all other requests to the string object, because a DN is mainly
# used within the library as a string
# used within the library as a string
...
@@ -277,6 +279,12 @@ module Gitlab
...
@@ -277,6 +279,12 @@ module Gitlab
def
method_missing
(
method
,
*
args
,
&
block
)
def
method_missing
(
method
,
*
args
,
&
block
)
@dn
.
send
(
method
,
*
args
,
&
block
)
@dn
.
send
(
method
,
*
args
,
&
block
)
end
end
##
# Redefined to be consistent with redefined `method_missing` behavior
def
respond_to?
(
sym
,
include_private
=
false
)
@dn
.
respond_to?
(
sym
,
include_private
)
end
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment