From 82a936a0ceba0508d29cc9f6da84c5a98ae7bede Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Tue, 11 Jun 2013 13:01:03 +0900 Subject: [PATCH] Fix a typo and DRY with dir_config() calls. --- ext/nokogiri/extconf.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index 600966c466..bfbfe4e82f 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -130,15 +130,13 @@ def have_iconv? end def each_idir - # If --with-iconv-dir is given, it should be the first priority - idir = preserving_globals { - dir_config('iconv') - }.first and yield idirta - - # Then --with-opt-dir - idir = preserving_globals { - dir_config('opt') - }.first and yield idir + # If --with-iconv-dir or --with-opt-dir is given, it should be + # the first priority + %w[iconv opt].each { |config| + idir = preserving_globals { + dir_config(config) + }.first and yield idir + } # Try the system default yield "/usr/include"