Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GitHub Mirror
2factorauth
twofactorauth
Commits
b8d82602
Unverified
Commit
b8d82602
authored
Jan 31, 2022
by
Michael Loßin
Committed by
GitHub
Jan 31, 2022
Browse files
Ignore exclusions for regions.json (#6453)
* Ignore exclusions for regions.json * Fix rubocop issue
parent
ec1f8f4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
scripts/APIv2.rb
View file @
b8d82602
...
...
@@ -22,7 +22,7 @@ Dir.glob('entries/*/*.json') do |file|
entry
[
'tfa'
]
=
website
[
'tfa'
].
map
{
|
e
|
rplc_ptrn
.
keys
.
include?
(
e
)
?
rplc_ptrn
[
e
]
:
e
}
unless
website
[
'tfa'
].
nil?
website
[
'contact'
]
&
.
each
{
|
a
,
b
|
a
.
eql?
(
'email'
)
?
entry
[
'email_address'
]
=
b
:
entry
[
a
]
=
b
}
website
[
'regions'
]
&
.
each
{
|
region
|
regions
[
region
]
=
1
+
regions
[
region
].
to_i
}
website
[
'regions'
]
&
.
each
{
|
region
|
regions
[
region
]
=
1
+
regions
[
region
].
to_i
unless
region
[
0
]
==
'-'
}
all
[
category
].
nil?
?
all
[
category
]
=
{
name
=>
entry
}
:
all
[
category
][
name
]
=
entry
# Initialize the object
end
...
...
scripts/APIv3.rb
View file @
b8d82602
...
...
@@ -12,6 +12,8 @@ Dir.glob('entries/*/*.json') { |file| all[JSON.parse(File.read(file)).keys[0]] =
all
.
sort
.
to_h
.
each
do
|
k
,
v
|
v
[
'tfa'
]
&
.
each
{
|
method
|
(
tfa
[
method
].
nil?
?
tfa
[
method
]
=
{
k
=>
v
}
:
tfa
[
method
][
k
]
=
v
)
}
v
[
'regions'
]
&
.
each
do
|
region
|
next
if
region
[
0
]
==
'-'
regions
[
region
]
=
{}
unless
regions
.
key?
region
regions
[
region
][
'count'
]
=
1
+
regions
[
region
][
'count'
].
to_i
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