From 8091b33f85c96a93d14de80ce3bfd9c32f8bb58c Mon Sep 17 00:00:00 2001
From: Martin Afanasjew <martin@afanasjew.de>
Date: Mon, 9 Nov 2015 23:08:50 +0100
Subject: [PATCH] ruby 1.8: address syntax warnings in Homebrew core

Closes Homebrew/homebrew#45849.

Signed-off-by: Xu Cheng <xucheng@me.com>
---
 Library/Homebrew/cmd/audit.rb          | 2 +-
 Library/Homebrew/test/test_formula.rb  | 2 +-
 Library/Homebrew/test/test_migrator.rb | 2 +-
 Library/Homebrew/test/test_pathname.rb | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 1d293994f8..231e583bb3 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -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
diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb
index 4d198ba28d..c30f595bfa 100644
--- a/Library/Homebrew/test/test_formula.rb
+++ b/Library/Homebrew/test/test_formula.rb
@@ -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
diff --git a/Library/Homebrew/test/test_migrator.rb b/Library/Homebrew/test/test_migrator.rb
index f69da3f6f0..7816350934 100644
--- a/Library/Homebrew/test/test_migrator.rb
+++ b/Library/Homebrew/test/test_migrator.rb
@@ -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
diff --git a/Library/Homebrew/test/test_pathname.rb b/Library/Homebrew/test/test_pathname.rb
index 0f36038dc9..5456c5bdc2 100644
--- a/Library/Homebrew/test/test_pathname.rb
+++ b/Library/Homebrew/test/test_pathname.rb
@@ -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
-- 
GitLab