viewblocklist.rb 334 B

123456789101112131415161718192021
  1. require "gdbm"
  2. db = GDBM.new ARGV[0]
  3. if db.has_key? "blocklist"
  4. bl = db["blocklist"].to_s.split "~~~"
  5. if bl.length == 0
  6. puts "The blocklist contains no entries."
  7. else
  8. i = 1
  9. bl.each { |b64|
  10. puts "Entry #{i} - #{b64} \n"
  11. i += 1
  12. }
  13. end
  14. else
  15. puts "There is no block list in the file."
  16. end
  17. db.close