diff options
| -rw-r--r-- | Library/Homebrew/brew.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/artifact/relocated.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/style.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/dev-cmd/audit.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/diagnostic.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/extend/os/mac/keg_relocate.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/tap_constants.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/test/cmd/--env_spec.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/test/cmd/--version_spec.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/test/support/helper/spec/shared_examples/hbc_staged.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/utils/github.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/version.rb | 2 | 
14 files changed, 18 insertions, 18 deletions
| diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index e07599ac6..9b2ff75f0 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -24,7 +24,7 @@ def require?(path)    require path  rescue LoadError => e    # we should raise on syntax errors but not if the file doesn't exist. -  raise unless e.to_s.include? path +  raise unless e.message.include?(path)  end  begin diff --git a/Library/Homebrew/cask/lib/hbc/artifact/relocated.rb b/Library/Homebrew/cask/lib/hbc/artifact/relocated.rb index 7757d32d0..4dba46c9d 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/relocated.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/relocated.rb @@ -35,10 +35,10 @@ module Hbc          altnames = "(#{altnames})"          # Some packges are shipped as u=rx (e.g. Bitcoin Core) -        @command.run!("/bin/chmod", args: ["--", "u+rw", file.to_s, file.realpath.to_s]) +        @command.run!("/bin/chmod", args: ["--", "u+rw", file, file.realpath])          @command.run!("/usr/bin/xattr", -                      args:         ["-w", ALT_NAME_ATTRIBUTE, altnames, file.to_s], +                      args:         ["-w", ALT_NAME_ATTRIBUTE, altnames, file],                        print_stderr: false)        end diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb index aa795fc59..37784f4c3 100644 --- a/Library/Homebrew/cask/lib/hbc/cli.rb +++ b/Library/Homebrew/cask/lib/hbc/cli.rb @@ -113,7 +113,7 @@ module Hbc        if command.respond_to?(:run)          # usual case: built-in command verb          command.run(*rest) -      elsif require? which("brewcask-#{command}.rb").to_s +      elsif require?(which("brewcask-#{command}.rb"))          # external command as Ruby library on PATH, Homebrew-style        elsif command.to_s.include?("/") && require?(command.to_s)          # external command as Ruby library with literal path, useful diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index cf41d91ee..687ee36b8 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -94,7 +94,7 @@ module Homebrew      if files.nil?        args << "--config" << HOMEBREW_LIBRARY_PATH/".rubocop.yml" -      args += [HOMEBREW_LIBRARY_PATH] +      args << HOMEBREW_LIBRARY_PATH      else        args << "--config" << HOMEBREW_LIBRARY/".rubocop.yml"        args += files diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index cb25ca794..1a7338b19 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -909,7 +909,7 @@ class FormulaAuditor      end      bin_names.each do |name|        ["system", "shell_output", "pipe_output"].each do |cmd| -        if text =~ %r{(def test|test do).*(#{Regexp.escape HOMEBREW_PREFIX}/bin/)?#{cmd}[\(\s]+['"]#{Regexp.escape name}[\s'"]}m +        if text =~ %r{(def test|test do).*(#{Regexp.escape(HOMEBREW_PREFIX)}/bin/)?#{cmd}[\(\s]+['"]#{Regexp.escape(name)}[\s'"]}m            problem %Q(fully scope test #{cmd} calls e.g. #{cmd} "\#{bin}/#{name}")          end        end diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 1544e6765..9ebc250fe 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -119,7 +119,7 @@ module Homebrew          return unless which("python")          anaconda_directory = which("anaconda").realpath.dirname -        python_binary = Utils.popen_read which("python"), "-c", "import sys; sys.stdout.write(sys.executable)" +        python_binary = Utils.popen_read(which("python"), "-c", "import sys; sys.stdout.write(sys.executable)")          python_directory = Pathname.new(python_binary).realpath.dirname          # Only warn if Python lives with Anaconda, since is most problematic case. diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb index 0b2ecd1c9..e541df839 100644 --- a/Library/Homebrew/extend/os/mac/keg_relocate.rb +++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb @@ -63,9 +63,9 @@ class Keg    # expensive recursive search if possible.    def fixed_name(file, bad_name)      if bad_name.start_with? PREFIX_PLACEHOLDER -      bad_name.sub(PREFIX_PLACEHOLDER, HOMEBREW_PREFIX.to_s) +      bad_name.sub(PREFIX_PLACEHOLDER, HOMEBREW_PREFIX)      elsif bad_name.start_with? CELLAR_PLACEHOLDER -      bad_name.sub(CELLAR_PLACEHOLDER, HOMEBREW_CELLAR.to_s) +      bad_name.sub(CELLAR_PLACEHOLDER, HOMEBREW_CELLAR)      elsif (file.dylib? || file.mach_o_bundle?) && (file.parent + bad_name).exist?        "@loader_path/#{bad_name}"      elsif file.mach_o_executable? && (lib + bad_name).exist? diff --git a/Library/Homebrew/tap_constants.rb b/Library/Homebrew/tap_constants.rb index 4ef8015c2..773eff816 100644 --- a/Library/Homebrew/tap_constants.rb +++ b/Library/Homebrew/tap_constants.rb @@ -3,7 +3,7 @@ HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w+-.@]+)$}  # match taps' casks, e.g. someuser/sometap/somecask  HOMEBREW_TAP_CASK_REGEX = %r{^([\w-]+)/([\w-]+)/([a-z0-9\-]+)$}  # match taps' directory paths, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap -HOMEBREW_TAP_DIR_REGEX = %r{#{Regexp.escape(HOMEBREW_LIBRARY.to_s)}/Taps/([\w-]+)/([\w-]+)} +HOMEBREW_TAP_DIR_REGEX = %r{#{Regexp.escape(HOMEBREW_LIBRARY)}/Taps/([\w-]+)/([\w-]+)}  # match taps' formula paths, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap/someformula  HOMEBREW_TAP_PATH_REGEX = Regexp.new(HOMEBREW_TAP_DIR_REGEX.source + %r{/(.*)}.source)  # match the default and the versions brew-cask tap e.g. Caskroom/cask or Caskroom/versions diff --git a/Library/Homebrew/test/cmd/--env_spec.rb b/Library/Homebrew/test/cmd/--env_spec.rb index 7dd84132a..9ccdaa6f1 100644 --- a/Library/Homebrew/test/cmd/--env_spec.rb +++ b/Library/Homebrew/test/cmd/--env_spec.rb @@ -9,7 +9,7 @@ describe "brew --env", :integration_test do    describe "--shell=bash" do      it "prints the Homebrew build environment variables in Bash syntax" do        expect { brew "--env", "--shell=bash" } -        .to output(/export CMAKE_PREFIX_PATH="#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"/).to_stdout +        .to output(/export CMAKE_PREFIX_PATH="#{Regexp.quote(HOMEBREW_PREFIX)}"/).to_stdout          .and not_to_output.to_stderr          .and be_a_success      end @@ -18,7 +18,7 @@ describe "brew --env", :integration_test do    describe "--shell=fish" do      it "prints the Homebrew build environment variables in Fish syntax" do        expect { brew "--env", "--shell=fish" } -        .to output(/set [-]gx CMAKE_PREFIX_PATH "#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"/).to_stdout +        .to output(/set [-]gx CMAKE_PREFIX_PATH "#{Regexp.quote(HOMEBREW_PREFIX)}"/).to_stdout          .and not_to_output.to_stderr          .and be_a_success      end @@ -27,7 +27,7 @@ describe "brew --env", :integration_test do    describe "--shell=tcsh" do      it "prints the Homebrew build environment variables in Tcsh syntax" do        expect { brew "--env", "--shell=tcsh" } -        .to output(/setenv CMAKE_PREFIX_PATH #{Regexp.quote(HOMEBREW_PREFIX.to_s)};/).to_stdout +        .to output(/setenv CMAKE_PREFIX_PATH #{Regexp.quote(HOMEBREW_PREFIX)};/).to_stdout          .and not_to_output.to_stderr          .and be_a_success      end diff --git a/Library/Homebrew/test/cmd/--version_spec.rb b/Library/Homebrew/test/cmd/--version_spec.rb index 8992629d7..8dc183882 100644 --- a/Library/Homebrew/test/cmd/--version_spec.rb +++ b/Library/Homebrew/test/cmd/--version_spec.rb @@ -1,7 +1,7 @@  describe "brew --version", :integration_test do    it "prints the Homebrew version" do      expect { brew "--version" } -      .to output(/^Homebrew #{Regexp.escape(HOMEBREW_VERSION.to_s)}\n/).to_stdout +      .to output(/^Homebrew #{Regexp.escape(HOMEBREW_VERSION)}\n/).to_stdout        .and not_to_output.to_stderr        .and be_a_success    end diff --git a/Library/Homebrew/test/support/helper/spec/shared_examples/hbc_staged.rb b/Library/Homebrew/test/support/helper/spec/shared_examples/hbc_staged.rb index 31083ee58..1364c13a3 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_examples/hbc_staged.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_examples/hbc_staged.rb @@ -24,7 +24,7 @@ shared_examples Hbc::Staged do    end    it "can get the Info.plist file for the primary app" do -    expect(staged.info_plist_file.to_s).to include Hbc.appdir.join("TestCask.app/Contents/Info.plist") +    expect(staged.info_plist_file).to eq Hbc.appdir.join("TestCask.app/Contents/Info.plist")    end    it "can execute commands on the Info.plist file" do diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index c37633e41..8225adfe3 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -75,7 +75,7 @@ def odeprecated(method, replacement = nil, disable: false, disable_on: nil, call    backtrace = caller    tap_message = nil    caller_message = backtrace.detect do |line| -    next unless line =~ %r{^#{Regexp.escape HOMEBREW_LIBRARY}/Taps/([^/]+/[^/]+)/} +    next unless line =~ %r{^#{Regexp.escape(HOMEBREW_LIBRARY)}/Taps/([^/]+/[^/]+)/}      tap = Tap.fetch $1      tap_message = "\nPlease report this to the #{tap} tap!"      true diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index 88c5199c2..5ba381529 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -164,7 +164,7 @@ module GitHub          args += ["--data", "@#{data_tmpfile.path}"]        end -      args += ["--dump-header", headers_tmpfile.path.to_s] +      args += ["--dump-header", headers_tmpfile.path]        output, errors, status = curl_output(url.to_s, *args)        output, _, http_code = output.rpartition("\n") diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index da239f788..072da3eb8 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -307,7 +307,7 @@ class Version      spec_s = spec.to_s      stem = if spec.directory? -      spec.basename.to_s +      spec.basename      elsif %r{((?:sourceforge\.net|sf\.net)/.*)/download$} =~ spec_s        Pathname.new(spec.dirname).stem      elsif /\.[^a-zA-Z]+$/ =~ spec_s | 
