Commit 34b8ba31 authored by Dave Machado's avatar Dave Machado
Browse files

Add HTTPS Support check for Yes or No

parent e859668b
#!/usr/bin/env ruby #!/usr/bin/env ruby
auth_keys = ['apiKey', 'OAuth', 'X-Mashape-Key', 'No'] auth_keys = ['apiKey', 'OAuth', 'X-Mashape-Key', 'No']
https_keys = ['Yes', 'No']
args = ARGV args = ARGV
filename = args[0] filename = args[0]
fail_flag = false fail_flag = false
fail_count = 0
File.foreach(filename).with_index do |line, line_num| File.foreach(filename).with_index do |line, line_num|
line_num += 1 line_num += 1
# puts "#{line_num}: #{line}" # puts "#{line_num}: #{line}"
...@@ -14,14 +14,20 @@ File.foreach(filename).with_index do |line, line_num| ...@@ -14,14 +14,20 @@ File.foreach(filename).with_index do |line, line_num|
if line.eql? "|---|---|---|---|---|\n" if line.eql? "|---|---|---|---|---|\n"
next next
end end
values = line.split("|") values = line.split("|")
# 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 (#{auth_val}): #{line}" puts "(#{line_num}) Invalid Auth (not a valid option): #{auth_val}"
fail_flag = false fail_flag = true
fail_count += 1 end
# Check HTTPS Support values to be either "Yes" or "No"
https_val = values[4].lstrip.chop
if !https_keys.include?(https_val)
puts "(#{line_num}) Invalid HTTPS: (must use \"Yes\" or \"No\"): #{https_val}"
fail_flag = true
end end
end end
end end
Supports Markdown
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