Skip to content

Commit

Permalink
Fix a typo and DRY with dir_config() calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
knu committed Jun 11, 2013
1 parent c7ef9b3 commit 82a936a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions ext/nokogiri/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 82a936a

Please sign in to comment.