Sha256: e26c585730c960b5b5db815937f01ace7204d2bcd3d7700cb32418a7117cee5b

Contents?: true

Size: 567 Bytes

Versions: 5

Compression:

Stored size: 567 Bytes

Contents

#!/usr/bin/env ruby
# Given an array of domains, removes them from the list
# Example usage: script/prune foo.invalid, bar.invalid, foo.bar.invalid

require_relative '../lib/gman'
require_relative '../lib/gman/domain_list'

domains = ARGV
domains = domains.clone.map { |d| d.delete ',' }

list = File.open('./config/domains.txt').read
puts "Starting list: #{Gman::DomainList.current.count} domains"

domains.each do |domain|
  list.gsub!(/^#{domain}$\n/, '')
end

puts "Ending list: #{Gman::DomainList.current.count} domains"

File.write './config/domains.txt', list

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gman-7.0.2 script/prune
gman-7.0.1 script/prune
gman-7.0.0 script/prune
gman-6.0.1 script/prune
gman-6.0.0 script/prune