require "cli/parser" require "open-uri" require "resource" require "formula" module Homebrew module_function def aspell_dictionaries_args Homebrew::CLI::Parser.new do usage_banner <<~EOS `aspell-dictionaries` Generates the new dictionaries for the `aspell` formula. EOS end end def aspell_dictionaries aspell_dictionaries_args.parse dict_url = "https://ftp.gnu.org/gnu/aspell/dict" dict_mirror = "https://ftpmirror.gnu.org/aspell/dict" languages = {} URI.parse("#{dict_url}/0index.html").open do |content| content.each_line do |line| break if line.start_with?("