diff options
| author | Alexis Hildebrandt | 2010-09-16 21:59:37 +0200 |
|---|---|---|
| committer | Adam Vandenberg | 2010-09-16 13:09:46 -0700 |
| commit | 1f41920623c14821b9110cdd39e10ec0b6079de8 (patch) | |
| tree | 2cf1e767611b484f294ff47b75d8f4f99f7473b5 /Library/Formula | |
| parent | 53dff875a677d18864da8c297663efda8464a54f (diff) | |
| download | homebrew-1f41920623c14821b9110cdd39e10ec0b6079de8.tar.bz2 | |
Update Formula: aspell
Add --all option to install all available dictionaries.
List dictionaries that fail to install in caveats and omit these
when installing all dictionaires via the --all option.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/aspell.rb | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/Library/Formula/aspell.rb b/Library/Formula/aspell.rb index d743a4870..b478ca38e 100644 --- a/Library/Formula/aspell.rb +++ b/Library/Formula/aspell.rb @@ -14,8 +14,10 @@ class Aspell <Formula md5 'bc80f0198773d5c05086522be67334eb' def options - [['--lang=XX,...', - "Install dictionary for language XX where XX is the country code, e.g.: --lang=en,es\n\tAvailable country codes: #{available_languages.join(', ')} "]] + [ + ['--lang=XX,...', "Install dictionary for language XX where XX is the country code, e.g.: --lang=en,es\n\tAvailable country codes: #{available_languages.join(', ')}"], + ['--all', "Install all available dictionaries"] + ] end def install @@ -23,13 +25,18 @@ class Aspell <Formula system "./configure", "--prefix=#{prefix}" system "make install" - ARGV.options_only.select { |v| v =~ /--lang=/ }.uniq.each do |opt| - languages = opt.split('=')[1].split(',') - languages.each do |lang| - formula = Object.const_get("Aspell_" + lang).new - formula.brew { formula.install } + languages = [] + if ARGV.include?('--all') + languages << available_languages.to_a - broken_dictionaries.to_a + else + ARGV.options_only.select { |v| v =~ /--lang=/ }.uniq.each do |opt| + languages << opt.split('=')[1].split(',') end end + languages.flatten.each do |lang| + formula = Object.const_get("Aspell_" + lang).new + formula.brew { formula.install } + end end # TODO remove when options works properly @@ -40,10 +47,17 @@ class Aspell <Formula For the following languages aspell dictionaries are available: #{available_languages.join(', ')} + + The dictionaries for the following languages seem to be broken: + #{broken_dictionaries.join(', ')} EOS end end +def broken_dictionaries + %w( br cy el fr gv nl tr wa) +end + # BEGIN generated with brew-aspell-dictionaries class Aspell_af <AspellLang url 'http://ftp.gnu.org/gnu/aspell/dict/af/aspell-af-0.50-0.tar.bz2' |
