Sha256: e0260db1f7e79fdd1d035524af4efda2b07c3cb839684bdbb232e6bd7b670e3c

Contents?: true

Size: 613 Bytes

Versions: 3

Compression:

Stored size: 613 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

# 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!(/^#{Regexp.escape(domain)}$\n/, '')
end

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gman-7.0.5 script/prune
gman-7.0.4 script/prune
gman-7.0.3 script/prune