addblentry.rb 244 B

123456789101112131415
  1. require "gdbm"
  2. db = GDBM.new ARGV[0]
  3. if not db.has_key? "blocklist"
  4. puts "The file does not contain a block list - so one is created."
  5. end
  6. bl = db["blocklist"].to_s.split "~~~"
  7. bl << ARGV[1].to_s
  8. db["blocklist"] = bl.join "~~~"
  9. db.close