aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Contributions
diff options
context:
space:
mode:
authorJack Nagel2014-07-06 22:46:00 -0500
committerJack Nagel2014-07-06 22:46:34 -0500
commitaeccba8dbedb18d5fa28a453435825e766da4979 (patch)
tree69f13a99d30e743ed27b20e6db40afe4a09ce4b9 /Library/Contributions
parent3952a4acc67aac7cce3d0941e9eb28b14d5b26d7 (diff)
downloadbrew-aeccba8dbedb18d5fa28a453435825e766da4979.tar.bz2
Fix brew-aspell-dictionaries
Diffstat (limited to 'Library/Contributions')
-rwxr-xr-xLibrary/Contributions/cmd/brew-aspell-dictionaries.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/Library/Contributions/cmd/brew-aspell-dictionaries.rb b/Library/Contributions/cmd/brew-aspell-dictionaries.rb
index 4816f7239..2a5f8ccb5 100755
--- a/Library/Contributions/cmd/brew-aspell-dictionaries.rb
+++ b/Library/Contributions/cmd/brew-aspell-dictionaries.rb
@@ -4,8 +4,7 @@ require 'formula'
dict_url = "http://ftpmirror.gnu.org/aspell/dict"
dict_mirror = "http://ftp.gnu.org/gnu/aspell/dict"
-
-resources = {}
+languages = {}
open("#{dict_url}/0index.html") do |content|
content.each_line do |line|
@@ -15,22 +14,23 @@ open("#{dict_url}/0index.html") do |content|
fields = line.split('"')
lang, path = fields[1], fields[3]
lang.gsub!("-", "_")
- resources[lang] = path
+ languages[lang] = path
end
end
-resources.each_pair do |lang, path|
- r = Resource.new(lang, "#{dict_url}/#{path}")
- r.owner = Formula.factory('aspell')
-
- nostdout { r.fetch }
-
+languages.inject([]) do |resources, (lang, path)|
+ r = Resource.new(lang)
+ r.owner = Formulary.factory("aspell")
+ r.url "#{dict_url}/#{path}"
+ r.mirror "#{dict_mirror}/#{path}"
+ resources << r
+end.each(&:fetch).each do |r|
puts <<-EOS
- resource '#{lang}' do
- url '#{dict_url}/#{path}'
- mirror '#{dict_mirror}/#{path}'
- sha1 '#{r.cached_download.sha1}'
- end
+ resource "#{r.name}" do
+ url "#{r.url}"
+ mirror "#{r.mirrors.first}"
+ sha1 "#{r.cached_download.sha1}"
+ end
-EOS
+ EOS
end