1 # frozen_string_literal: true
10 def aspell_dictionaries_args
11 Homebrew::CLI::Parser.new do
15 Generates the new dictionaries for the `aspell` formula.
20 def aspell_dictionaries
21 aspell_dictionaries_args.parse
23 dictionary_url = "https://ftp.gnu.org/gnu/aspell/dict"
24 dictionary_mirror = "https://ftpmirror.gnu.org/aspell/dict"
27 index_output, = Utils::Curl.curl_output("#{dictionary_url}/0index.html")
28 index_output.split("<tr><td>").each do |line|
29 next unless line.start_with?("<a ")
31 _, language, _, path, = line.split('"')
32 language.tr!("-", "_")
33 languages[language] = path
36 resources = languages.map do |language, path|
37 r = Resource.new(language)
38 r.owner = Formula["aspell"]
39 r.url "#{dictionary_url}/#{path}"
40 r.mirror "#{dictionary_mirror}/#{path}"
44 output = resources.map do |resource|
45 resource.fetch(verify_download_integrity: false)
48 resource "#{resource.name}" do
50 mirror "#{resource.mirrors.first}"
51 sha256 "#{resource.cached_download.sha256}"