Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
public-apis
Commits
4206f34c
Commit
4206f34c
authored
Jul 10, 2017
by
Dave Machado
Browse files
Check Links for [Go] wrapper
parent
34b8ba31
Changes
1
Hide whitespace changes
Inline
Side-by-side
build/validate.rb
View file @
4206f34c
...
@@ -19,15 +19,22 @@ File.foreach(filename).with_index do |line, line_num|
...
@@ -19,15 +19,22 @@ File.foreach(filename).with_index do |line, line_num|
# Check Auth values to conform to valid options only
# Check Auth values to conform to valid options only
auth_val
=
values
[
3
].
lstrip
.
chop
.
tr
(
'``'
,
''
)
auth_val
=
values
[
3
].
lstrip
.
chop
.
tr
(
'``'
,
''
)
if
!
auth_keys
.
include?
(
auth_val
)
if
!
auth_keys
.
include?
(
auth_val
)
puts
"(
#{
line_num
}
) Invalid Auth (not a valid option):
#{
auth_val
}
"
puts
"(
#{
line_num
}
) Invalid Auth (not a valid option):
#{
auth_val
}
"
fail_flag
=
true
fail_flag
=
true
end
end
# Check HTTPS Support values to be either "Yes" or "No"
# Check HTTPS Support values to be either "Yes" or "No"
https_val
=
values
[
4
].
lstrip
.
chop
https_val
=
values
[
4
].
lstrip
.
chop
if
!
https_keys
.
include?
(
https_val
)
if
!
https_keys
.
include?
(
https_val
)
puts
"(
#{
line_num
}
) Invalid HTTPS: (must use
\"
Yes
\"
or
\"
No
\"
):
#{
https_val
}
"
puts
"(
#{
line_num
}
) Invalid HTTPS: (must use
\"
Yes
\"
or
\"
No
\"
):
#{
https_val
}
"
fail_flag
=
true
fail_flag
=
true
end
# Check Link to ensure url is wrapped in "[Go!]" view
link_val
=
values
[
5
].
lstrip
.
chop
if
!
link_val
.
start_with?
(
"[Go!]("
)
||
!
link_val
.
end_with?
(
')'
)
puts
"(
#{
line_num
}
) Invalid Link: (format should be
\"
[Go!](<LINK>)
\"
):
#{
link_val
}
"
fail_flag
=
true
end
end
end
end
end
end
Write
Preview
Supports
Markdown
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