ruby 1.8: address syntax warnings in Homebrew core

Closes Homebrew/homebrew#45849.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Martin Afanasjew 2015-11-09 23:08:50 +01:00 committed by Xu Cheng
parent 4296ec63eb
commit 8091b33f85
4 changed files with 4 additions and 4 deletions

View File

@ -600,7 +600,7 @@ class FormulaAuditor
problem "\"Formula.factory(name)\" is deprecated in favor of \"Formula[name]\""
end
if text =~ /system "npm", "install"/ && text !~ %r[opt_libexec}/npm/bin]
if text =~ /system "npm", "install"/ && text !~ %r[opt_libexec\}/npm/bin]
need_npm = "\#{Formula[\"node\"].opt_libexec\}/npm/bin"
problem <<-EOS.undent
Please add ENV.prepend_path \"PATH\", \"#{need_npm}"\ to def install

View File

@ -33,7 +33,7 @@ class FormulaTests < Homebrew::TestCase
refute_predicate f, :any_version_installed?
prefix = HOMEBREW_CELLAR+f.name+"0.1"
prefix.mkpath
FileUtils.touch (prefix+Tab::FILENAME)
FileUtils.touch prefix+Tab::FILENAME
assert_predicate f, :any_version_installed?
ensure
f.rack.rmtree

View File

@ -184,7 +184,7 @@ class MigratorTests < Homebrew::TestCase
assert_predicate @new_keg_record, :exist?
assert_predicate @old_keg_record.parent, :symlink?
refute_predicate (HOMEBREW_LIBRARY/"LinkedKegs/oldname"), :exist?
refute_predicate HOMEBREW_LIBRARY/"LinkedKegs/oldname", :exist?
assert_equal @new_keg_record.realpath, (HOMEBREW_LIBRARY/"LinkedKegs/newname").realpath
assert_equal @new_keg_record.realpath, @old_keg_record.realpath
assert_equal @new_keg_record.realpath, (HOMEBREW_PREFIX/"opt/oldname").realpath

View File

@ -216,7 +216,7 @@ class PathnameInstallTests < Homebrew::TestCase
assert_predicate @dst+"bin", :directory?
assert_predicate @dst+"bin/a.txt", :exist?
assert_predicate @dst+"bin/b.txt", :exist?
assert_predicate (@dst+"bin").readlink, :relative?
assert_predicate((@dst+"bin").readlink, :relative?)
end
def test_install_relative_symlink