From dd900302139d106f3008950ac0bd2bd71f66ddf5 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 26 Dec 2014 11:58:09 -0500 Subject: [PATCH] Fix "possible reference to past scope" warnings on 2.2 --- Library/Homebrew/formula_installer.rb | 4 ++-- Library/Homebrew/keg.rb | 12 ++++++------ Library/Homebrew/tab.rb | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 09a651eaab..7cca750764 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -202,8 +202,8 @@ class FormulaInstaller return if ARGV.force? conflicts = formula.conflicts.select do |c| - formula = Formulary.factory(c.name) - formula.linked_keg.exist? && formula.opt_prefix.exist? + f = Formulary.factory(c.name) + f.linked_keg.exist? && f.opt_prefix.exist? end raise FormulaConflictError.new(formula, conflicts) unless conflicts.empty? diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 0c87dfc8c6..25656f25a4 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -259,8 +259,8 @@ class Keg link_dir('sbin', mode) {:skip_dir} link_dir('include', mode) {:link} - link_dir('share', mode) do |path| - case path.to_s + link_dir('share', mode) do |relative_path| + case relative_path.to_s when 'locale/locale.alias' then :skip_file when INFOFILE_RX then :info when LOCALEDIR_RX then :mkpath @@ -273,8 +273,8 @@ class Keg end end - link_dir('lib', mode) do |path| - case path.to_s + link_dir('lib', mode) do |relative_path| + case relative_path.to_s when 'charset.alias' then :skip_file # pkg-config database gets explicitly created when 'pkgconfig' then :mkpath @@ -294,12 +294,12 @@ class Keg end end - link_dir('Frameworks', mode) do |path| + link_dir('Frameworks', mode) do |relative_path| # Frameworks contain symlinks pointing into a subdir, so we have to use # the :link strategy. However, for Foo.framework and # Foo.framework/Versions we have to use :mkpath so that multiple formulae # can link their versions into it and `brew [un]link` works. - if path.to_s =~ /[^\/]*\.framework(\/Versions)?$/ + if relative_path.to_s =~ /[^\/]*\.framework(\/Versions)?$/ :mkpath else :link diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 29836365b9..135a5dcfc7 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -45,7 +45,7 @@ class Tab < OpenStruct def self.remap_deprecated_options deprecated_options, options deprecated_options.each do |deprecated_option| - option = options.find {|option| option.name == deprecated_option.old } + option = options.find { |o| o.name == deprecated_option.old } next unless option options -= [option] options << Option.new(deprecated_option.current, option.description)