diff options
| author | Adam Vandenberg | 2012-02-05 10:17:04 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2012-02-05 10:17:04 -0800 |
| commit | fac6b154f6d63ae87d9f8b06ffca5fed59a0eff0 (patch) | |
| tree | 5ed59a28e84b054157f867bdf0972ce6fdf2bcf5 /Library | |
| parent | 040a144031bfb1317c9a56e9be6a5c21d8af70e8 (diff) | |
| download | homebrew-fac6b154f6d63ae87d9f8b06ffca5fed59a0eff0.tar.bz2 | |
audiofile: cleanups
* Remove comment about compilers
* Flip test code to return early if we can't find the files we need
* remove 'end' comments
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/audiofile.rb | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/Library/Formula/audiofile.rb b/Library/Formula/audiofile.rb index 8c973e1f0..4a22229c3 100644 --- a/Library/Formula/audiofile.rb +++ b/Library/Formula/audiofile.rb @@ -7,8 +7,6 @@ class Audiofile < Formula depends_on 'lcov' if ARGV.include? '--with-lcov' -# Builds with all 3 compilers. Cheers Clang! - def options [ ['--with-lcov', 'Enable Code Coverage support using lcov.'], @@ -28,38 +26,36 @@ class Audiofile < Formula def test inn = '/System/Library/Sounds/Glass.aiff' out = 'Glass.wav' - hear = '/usr/bin/qlmanage' - conv = "#{HOMEBREW_PREFIX}/bin/sfconvert" - info = "#{HOMEBREW_PREFIX}/bin/sfinfo" - - puts '' - if File.exist?("#{conv}") and File.exist?("#{inn}") and - File.exist?("#{hear}") and File.exist?("#{info}") - mktemp do - system "#{conv} #{inn} #{out} format wave" - system "#{info} --short --reporterror #{out}" - system "#{hear} -p #{out}" if ARGV.verbose? - puts '' - oh1 <<-EOS.undent - Cheers mate. You converted a system sound from the Audio - Interchange File Format \"aiff\" to the MS RIFF Wave format. + hear_bin = '/usr/bin/qlmanage' + conv_bin = "#{HOMEBREW_PREFIX}/bin/sfconvert" + info_bin = "#{HOMEBREW_PREFIX}/bin/sfinfo" - EOS - end - else + unless File.exist?(conv_bin) and File.exist?(inn) and + File.exist?(hear_bin) and File.exist?(info_bin) opoo <<-EOS.undent The test program couldn't locate one of these files that normally exist: #{inn} - #{conv} - #{info} - #{hear} + #{conv_bin} + #{info_bin} + #{hear_bin} We are sorry for the mistake. Another test you can run on this software will occur during install if you add --with-check like this: EOS oh1 ' brew rm audiofile' oh1 ' brew -v install audiofile --with-check' - puts '' - end # if-else - end # def test + return + end + + mktemp do + system "#{conv_bin} #{inn} #{out} format wave" + system "#{info_bin} --short --reporterror #{out}" + system "#{hear_bin} -p #{out}" if ARGV.verbose? + puts + oh1 <<-EOS.undent + Cheers mate. You converted a system sound from the Audio + Interchange File Format \"aiff\" to the MS RIFF Wave format. + EOS + end + end end |
