You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 rivejä
714 B

  1. #!/usr/bin/env ruby
  2. auth_keys = ['apiKey', 'OAuth', 'X-Mashape-Key', 'No']
  3. args = ARGV
  4. filename = args[0]
  5. fail_flag = false
  6. fail_count = 0
  7. File.foreach(filename).with_index do |line, line_num|
  8. line_num += 1
  9. # puts "#{line_num}: #{line}"
  10. if line.start_with?('|')
  11. # Skip table schema lines
  12. if line.eql? "|---|---|---|---|---|\n"
  13. next
  14. end
  15. values = line.split("|")
  16. # Check Auth Values to conform to valid options only
  17. auth_val = values[3].lstrip.chop.tr('``', '')
  18. if !auth_keys.include? auth_val
  19. puts "(#{line_num}) Invalid Auth (#{auth_val}): #{line}"
  20. fail_flag = false
  21. fail_count += 1
  22. end
  23. end
  24. end