From a0f48619341c2cf6f1980a019bcd4005cf066e21 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Mon, 9 Oct 2017 16:46:01 +0100 Subject: [PATCH 01/13] audit: broaden refute_predicate nudge --- Library/Homebrew/dev-cmd/audit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 200b2597f3..4d9000fed7 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -974,8 +974,8 @@ class FormulaAuditor problem "Use `assert_predicate , :exist?` instead of `#{Regexp.last_match(1)}`" end - if line =~ /assert !File\.exist\?/ - problem "Use `refute_predicate , :exist?` instead of `assert !File.exist?`" + if line =~ /(assert !File\.exist\?|assert !\(.*\)\.exist\?)/ + problem "Use `refute_predicate , :exist?` instead of `#{Regexp.last_match(1)}`" end return unless @strict From 811f5fd145d68393e056b6f6c584bf7a198b6986 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 10 Oct 2017 13:35:49 +0000 Subject: [PATCH 02/13] pull: fix bintray verification failing due to redirection --- Library/Homebrew/dev-cmd/pull.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb index 8cb2703035..aa3c9a9d71 100644 --- a/Library/Homebrew/dev-cmd/pull.rb +++ b/Library/Homebrew/dev-cmd/pull.rb @@ -560,7 +560,7 @@ module Homebrew req = Net::HTTP::Head.new bottle_info.url req.initialize_http_header "User-Agent" => HOMEBREW_USER_AGENT_RUBY res = http.request req - break if res.is_a?(Net::HTTPSuccess) + break if res.is_a?(Net::HTTPSuccess) || res.code == "302" unless res.is_a?(Net::HTTPClientError) raise "Failed to find published #{f} bottle at #{url} (#{res.code} #{res.message})!" From 0865ab0d1b25c9f6809c07fe6f4c02e71c2f0d27 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Mon, 9 Oct 2017 16:48:01 +0100 Subject: [PATCH 03/13] audit: nudge to use predicate for 'executable?' as well --- Library/Homebrew/dev-cmd/audit.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 4d9000fed7..a9d27afa98 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -978,6 +978,10 @@ class FormulaAuditor problem "Use `refute_predicate , :exist?` instead of `#{Regexp.last_match(1)}`" end + if line =~ /(assert File\.executable\?|assert \(.*\)\.executable\?)/ + problem "Use `assert_predicate , :executable?` instead of `#{Regexp.last_match(1)}`" + end + return unless @strict problem "`#{Regexp.last_match(1)}` in formulae is deprecated" if line =~ /(env :(std|userpaths))/ From 71b6e239d722bd1d444a5c5e2777d61208cc8049 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 9 Oct 2017 18:27:02 +0200 Subject: [PATCH 04/13] Set RuboCop maximum to current maximum. --- Library/.rubocop.yml | 16 ++++++++-------- Library/{.auditcops.yml => .rubocop_audit.yml} | 0 Library/Homebrew/.rubocop.yml | 14 ++++++++++---- Library/Homebrew/cmd/style.rb | 2 +- Library/Homebrew/test/cmd/style_spec.rb | 4 ++-- 5 files changed, 21 insertions(+), 15 deletions(-) rename Library/{.auditcops.yml => .rubocop_audit.yml} (100%) diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index dd6e039b09..8e45668d93 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -63,26 +63,26 @@ Metrics/AbcSize: Max: 250 Metrics/BlockLength: - Max: 1250 + Max: 144 Metrics/ClassLength: - Max: 1500 + Max: 589 Metrics/CyclomaticComplexity: Max: 75 Metrics/LineLength: - Max: 400 + Max: 324 Metrics/MethodLength: - Max: 250 + Max: 222 Metrics/ModuleLength: CountComments: false - Exclude: - - '**/bin/**/*' - - '**/cmd/**/*' - - '**/lib/**/*' + Max: 367 + +Metrics/ParameterLists: + CountKeywordArgs: false Metrics/PerceivedComplexity: Max: 100 diff --git a/Library/.auditcops.yml b/Library/.rubocop_audit.yml similarity index 100% rename from Library/.auditcops.yml rename to Library/.rubocop_audit.yml diff --git a/Library/Homebrew/.rubocop.yml b/Library/Homebrew/.rubocop.yml index 1434686432..0e1fb2d041 100644 --- a/Library/Homebrew/.rubocop.yml +++ b/Library/Homebrew/.rubocop.yml @@ -25,14 +25,20 @@ Lint/NestedMethodDefinition: Lint/ParenthesesAsGroupedExpression: Enabled: true +Metrics/BlockLength: + Max: 1250 + Metrics/BlockNesting: Max: 5 -Metrics/ModuleLength: - Max: 360 +Metrics/ClassLength: + Max: 1226 -Metrics/ParameterLists: - CountKeywordArgs: false +Metrics/LineLength: + Max: 244 + +Metrics/MethodLength: + Max: 195 # we won't change backward compatible method names Naming/MethodName: diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index 58f430a27d..89484d67d9 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -109,7 +109,7 @@ module Homebrew args << "--config" << HOMEBREW_LIBRARY_PATH/".rubocop.yml" args << HOMEBREW_LIBRARY_PATH else - args << "--config" << HOMEBREW_LIBRARY/".auditcops.yml" + args << "--config" << HOMEBREW_LIBRARY/".rubocop_audit.yml" args += files end diff --git a/Library/Homebrew/test/cmd/style_spec.rb b/Library/Homebrew/test/cmd/style_spec.rb index 4701036f10..9bc8fcab15 100644 --- a/Library/Homebrew/test/cmd/style_spec.rb +++ b/Library/Homebrew/test/cmd/style_spec.rb @@ -4,12 +4,12 @@ describe "brew style" do around(:each) do |example| begin FileUtils.ln_s HOMEBREW_LIBRARY_PATH, HOMEBREW_LIBRARY/"Homebrew" - FileUtils.ln_s HOMEBREW_LIBRARY_PATH.parent/".rubocop.yml", HOMEBREW_LIBRARY/".auditcops.yml" + FileUtils.ln_s HOMEBREW_LIBRARY_PATH.parent/".rubocop.yml", HOMEBREW_LIBRARY/".rubocop_audit.yml" example.run ensure FileUtils.rm_f HOMEBREW_LIBRARY/"Homebrew" - FileUtils.rm_f HOMEBREW_LIBRARY/".auditcops.yml" + FileUtils.rm_f HOMEBREW_LIBRARY/".rubocop_audit.yml" end end From 5b8a3d381b5fe3bcc0e55e49a7d3a875e264fc66 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 7 Oct 2017 16:27:29 +0200 Subject: [PATCH 05/13] Refactor `MacOS::languages`. --- Library/Homebrew/os/mac.rb | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 853f75140f..9dbb252e4c 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -47,19 +47,11 @@ module OS end def languages - return @languages unless @languages.nil? - - @languages = Utils.popen_read("defaults", "read", ".GlobalPreferences", "AppleLanguages").scan(/[^ \n"(),]+/) - - if ENV["HOMEBREW_LANGUAGES"] - @languages = ENV["HOMEBREW_LANGUAGES"].split(",") + @languages - end - - if ARGV.value("language") - @languages = ARGV.value("language").split(",") + @languages - end - - @languages = @languages.uniq + @languages ||= [ + *ARGV.value("language")&.split(","), + *ENV["HOMEBREW_LANGUAGES"]&.split(","), + *Open3.capture2("defaults", "read", "-g", "AppleLanguages")[0].scan(/[^ \n"(),]+/), + ].uniq end def language From 04363b25a3422ba1409a8853f14f16bfb7604d17 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 11 Oct 2017 15:32:39 +0200 Subject: [PATCH 06/13] Properly handle special characters in file names. --- Library/.rubocop.yml | 3 +++ .../Homebrew/cask/lib/hbc/container/dmg.rb | 24 ++++++++++--------- .../Homebrew/cask/lib/hbc/system_command.rb | 17 +++++++------ 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index dd6e039b09..fd90a2dde5 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -94,6 +94,9 @@ Performance/Caller: Style/Alias: EnforcedStyle: prefer_alias +Style/AsciiComments: + Enabled: false + Style/AutoResourceCleanup: Enabled: true diff --git a/Library/Homebrew/cask/lib/hbc/container/dmg.rb b/Library/Homebrew/cask/lib/hbc/container/dmg.rb index 1d172a4b7b..c0e43f68a0 100644 --- a/Library/Homebrew/cask/lib/hbc/container/dmg.rb +++ b/Library/Homebrew/cask/lib/hbc/container/dmg.rb @@ -88,7 +88,7 @@ module Hbc bomfile.close Tempfile.open(["", ".list"]) do |filelist| - filelist.write(bom_filelist_from_path(mount)) + filelist.puts(bom_filelist_from_path(mount)) filelist.close @command.run!("/usr/bin/mkbom", args: ["-s", "-i", filelist.path, "--", bomfile.path]) @@ -98,16 +98,17 @@ module Hbc end def bom_filelist_from_path(mount) - Dir.chdir(mount) do - Dir.glob("**/*", File::FNM_DOTMATCH).map do |path| - next if skip_path?(Pathname(path)) - (path == ".") ? path : path.prepend("./") - end.compact.join("\n").concat("\n") - end + # We need to use `find` here instead of Ruby in order to properly handle + # file names containing special characters, such as “e” + “´” vs. “é”. + @command.run("/usr/bin/find", args: [".", "-print0"], chdir: mount, print_stderr: false).stdout + .split("\0") + .reject { |path| skip_path?(mount, path) } + .join("\n") end - def skip_path?(path) - dmg_metadata?(path) || system_dir_symlink?(path) + def skip_path?(mount, path) + path = Pathname(path.sub(%r{^\./}, "")) + dmg_metadata?(path) || system_dir_symlink?(mount, path) end # unnecessary DMG metadata @@ -130,9 +131,10 @@ module Hbc DMG_METADATA_FILES.include?(relative_root.basename.to_s) end - def system_dir_symlink?(path) + def system_dir_symlink?(mount, path) + full_path = Pathname(mount).join(path) # symlinks to system directories (commonly to /Applications) - path.symlink? && MacOS.system_dir?(path.readlink) + full_path.symlink? && MacOS.system_dir?(full_path.readlink) end def mounts_from_plist(plist) diff --git a/Library/Homebrew/cask/lib/hbc/system_command.rb b/Library/Homebrew/cask/lib/hbc/system_command.rb index be083c29ef..6b9a28ab28 100644 --- a/Library/Homebrew/cask/lib/hbc/system_command.rb +++ b/Library/Homebrew/cask/lib/hbc/system_command.rb @@ -10,12 +10,12 @@ module Hbc class SystemCommand attr_reader :command - def self.run(executable, options = {}) - new(executable, options).run! + def self.run(executable, **options) + new(executable, **options).run! end - def self.run!(command, options = {}) - run(command, options.merge(must_succeed: true)) + def self.run!(command, **options) + run(command, **options.merge(must_succeed: true)) end def run! @@ -37,7 +37,7 @@ module Hbc result end - def initialize(executable, options) + def initialize(executable, **options) @executable = executable @options = options process_options! @@ -49,7 +49,7 @@ module Hbc def process_options! options.extend(HashValidator) - .assert_valid_keys :input, :print_stdout, :print_stderr, :args, :must_succeed, :sudo + .assert_valid_keys :input, :print_stdout, :print_stderr, :args, :must_succeed, :sudo, :chdir sudo_prefix = %w[/usr/bin/sudo -E --] sudo_prefix = sudo_prefix.insert(1, "-A") unless ENV["SUDO_ASKPASS"].nil? @command = [executable] @@ -76,8 +76,11 @@ module Hbc end def each_output_line(&b) + opts = {} + opts[:chdir] = options[:chdir] if options[:chdir] + raw_stdin, raw_stdout, raw_stderr, raw_wait_thr = - Open3.popen3(*expanded_command) + Open3.popen3(*expanded_command, **opts) write_input_to(raw_stdin) raw_stdin.close_write From c931a1be38485b57c9d50b852da0fcaa43cb180d Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Thu, 12 Oct 2017 19:57:23 +0200 Subject: [PATCH 07/13] Refactor `SystemCommand`. --- .../Homebrew/cask/lib/hbc/system_command.rb | 56 +++++++++++-------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/system_command.rb b/Library/Homebrew/cask/lib/hbc/system_command.rb index 6b9a28ab28..9ce3de907b 100644 --- a/Library/Homebrew/cask/lib/hbc/system_command.rb +++ b/Library/Homebrew/cask/lib/hbc/system_command.rb @@ -8,14 +8,14 @@ require "hbc/utils/hash_validator" module Hbc class SystemCommand - attr_reader :command + extend Predicable def self.run(executable, **options) new(executable, **options).run! end def self.run!(command, **options) - run(command, **options.merge(must_succeed: true)) + run(command, **options, must_succeed: true) end def run! @@ -26,38 +26,49 @@ module Hbc case type when :stdout processed_output[:stdout] << line - ohai line.chomp if options[:print_stdout] + ohai line.chomp if print_stdout? when :stderr processed_output[:stderr] << line - ohai line.chomp if options[:print_stderr] + ohai line.chomp if print_stderr? end end - assert_success if options[:must_succeed] + assert_success if must_succeed? result end - def initialize(executable, **options) + def initialize(executable, args: [], sudo: false, input: [], print_stdout: false, print_stderr: true, must_succeed: false, **options) + executable, *args = Shellwords.shellescape(executable) if args.empty? + @executable = executable + @args = args + @sudo = sudo + @input = input + @print_stdout = print_stdout + @print_stderr = print_stderr + @must_succeed = must_succeed + options.extend(HashValidator).assert_valid_keys(:chdir) @options = options - process_options! + end + + def command + @command ||= [ + *sudo_prefix, + executable, + *args, + ].freeze end private - attr_reader :executable, :options, :processed_output, :processed_status + attr_reader :executable, :args, :input, :options, :processed_output, :processed_status - def process_options! - options.extend(HashValidator) - .assert_valid_keys :input, :print_stdout, :print_stderr, :args, :must_succeed, :sudo, :chdir - sudo_prefix = %w[/usr/bin/sudo -E --] - sudo_prefix = sudo_prefix.insert(1, "-A") unless ENV["SUDO_ASKPASS"].nil? - @command = [executable] - options[:print_stderr] = true unless options.key?(:print_stderr) - @command.unshift(*sudo_prefix) if options[:sudo] - @command.concat(options[:args]) if options.key?(:args) && !options[:args].empty? - @command[0] = Shellwords.shellescape(@command[0]) if @command.size == 1 - nil + attr_predicate :sudo?, :print_stdout?, :print_stderr?, :must_succeed? + + def sudo_prefix + return [] unless sudo? + askpass_flags = ENV.key?("SUDO_ASKPASS") ? ["-A"] : [] + ["/usr/bin/sudo", *askpass_flags, "-E", "--"] end def assert_success @@ -76,11 +87,8 @@ module Hbc end def each_output_line(&b) - opts = {} - opts[:chdir] = options[:chdir] if options[:chdir] - raw_stdin, raw_stdout, raw_stderr, raw_wait_thr = - Open3.popen3(*expanded_command, **opts) + Open3.popen3(*expanded_command, **options) write_input_to(raw_stdin) raw_stdin.close_write @@ -90,7 +98,7 @@ module Hbc end def write_input_to(raw_stdin) - [*options[:input]].each { |line| raw_stdin.print line } + [*input].each(&raw_stdin.method(:print)) end def each_line_from(sources) From 82afe5d7f7855993a5410beba68bedc01492c846 Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Fri, 13 Oct 2017 00:35:05 -0700 Subject: [PATCH 08/13] fileutils: deprecate rake DSL superenv and the `:ruby` requirement make a `rake` DSL unnecessary. --- Library/Homebrew/compat/formula.rb | 5 +++++ Library/Homebrew/extend/fileutils.rb | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/compat/formula.rb b/Library/Homebrew/compat/formula.rb index 853a387069..57ab84a760 100644 --- a/Library/Homebrew/compat/formula.rb +++ b/Library/Homebrew/compat/formula.rb @@ -78,4 +78,9 @@ class Formula def startup_plist odeprecated "Formula#startup_plist", "Formula#plist" end + + def rake(*args) + # odeprecated "FileUtils#rake", "system \"rake\"" + system "rake", *args + end end diff --git a/Library/Homebrew/extend/fileutils.rb b/Library/Homebrew/extend/fileutils.rb index ed5bfe6c33..34ef3869fe 100644 --- a/Library/Homebrew/extend/fileutils.rb +++ b/Library/Homebrew/extend/fileutils.rb @@ -101,11 +101,6 @@ module FileUtils system Formulary.factory("scons").opt_bin/"scons", *args end - # Run the `rake` from the `ruby` Homebrew is using rather than whatever is in the `PATH`. - def rake(*args) - system RUBY_BIN/"rake", *args - end - # Run `make` 3.81 or newer. # Uses the system make on Leopard and newer, and the # path to the actually-installed make on Tiger or older. From 8fc559f31901d7776cf9873d9f84cd9a69f37be0 Mon Sep 17 00:00:00 2001 From: David C Hall Date: Fri, 13 Oct 2017 09:47:39 -0400 Subject: [PATCH 09/13] Update docs: homebrew/livecheck --- docs/External-Commands.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/External-Commands.md b/docs/External-Commands.md index e1178ceda1..881a1293a2 100644 --- a/docs/External-Commands.md +++ b/docs/External-Commands.md @@ -44,12 +44,12 @@ Note they are largely untested, and as always, be careful about running untested ### brew-livecheck Check if there is a new upstream version of a formula. -See the [`README`](https://github.com/youtux/homebrew-livecheck/blob/master/README.md) for more info and usage. +See the [`README`](https://github.com/Homebrew/homebrew-livecheck/blob/master/README.md) for more info and usage. Install using: ```sh -brew tap youtux/livecheck +brew tap homebrew/livecheck ``` ### brew-gem From 075f818118387b0d4a198732ba9632cad9607633 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Mon, 9 Oct 2017 17:01:35 +0100 Subject: [PATCH 10/13] formula_desc_cop: empty string is not a valid desc Just a slightly tweaked version of https://github.com/Homebrew/brew/issues/3286#issuecomment-334983011 --- Library/Homebrew/rubocops/formula_desc_cop.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/rubocops/formula_desc_cop.rb b/Library/Homebrew/rubocops/formula_desc_cop.rb index 2b613c9b49..2ef60303dc 100644 --- a/Library/Homebrew/rubocops/formula_desc_cop.rb +++ b/Library/Homebrew/rubocops/formula_desc_cop.rb @@ -18,8 +18,14 @@ module RuboCop return end - # Check if a formula's desc is too long + # Check the formula's desc length. Should be >0 and <80 characters. desc = parameters(desc_call).first + pure_desc_length = string_content(desc).length + if pure_desc_length.zero? + problem "The desc (description) should not be an empty string." + return + end + desc_length = "#{@formula_name}: #{string_content(desc)}".length max_desc_length = 80 return if desc_length <= max_desc_length From 29070e5cbecad6553b29bb482ce94352682b9c64 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Tue, 10 Oct 2017 15:43:07 +0100 Subject: [PATCH 11/13] formula_desc_cop_spec: add empty string test --- .../test/rubocops/formula_desc_cop_spec.rb | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb index ac8893e180..4816c3b269 100644 --- a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb @@ -27,6 +27,27 @@ describe RuboCop::Cop::FormulaAuditStrict::DescLength do end end + it "reports an offense when desc is an empty string" do + source = <<-EOS.undent + class Foo < Formula + url 'http://example.com/foo-1.0.tgz' + desc '' + end + EOS + + msg = "The desc (description) should not be an empty string." + expected_offenses = [{ message: msg, + severity: :convention, + line: 3, + column: 2, + source: source }] + + inspect_source(source, "/homebrew-core/Formula/foo.rb") + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + it "When desc is too long" do source = <<-EOS.undent class Foo < Formula From 8c3c72ec00430065d2f653ae1352662a4dd205d0 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 15 Oct 2017 22:04:20 +0200 Subject: [PATCH 12/13] Allow editing invalid Casks. --- Library/Homebrew/cask/lib/hbc/cli/edit.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/cli/edit.rb b/Library/Homebrew/cask/lib/hbc/cli/edit.rb index 8bce81c523..693edcd515 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/edit.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/edit.rb @@ -8,9 +8,6 @@ module Hbc end def run - cask = casks.first - cask_path = cask.sourcefile_path - odebug "Opening editor for Cask #{cask.token}" exec_editor cask_path rescue CaskUnavailableError => e reason = e.reason.empty? ? "" : "#{e.reason} " @@ -18,6 +15,14 @@ module Hbc raise e.class.new(e.token, reason) end + def cask_path + casks.first.sourcefile_path + rescue CaskInvalidError + path = CaskLoader.path(args.first) + return path if path.file? + raise + end + def self.help "edits the given Cask" end From 11572c749bae63b3bcc3a990d1f2e6e91c80677e Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Tue, 17 Oct 2017 15:14:39 -0400 Subject: [PATCH 13/13] Specifies which errant version of Ruby is used in raise. --- Library/Homebrew/brew.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index 86b40a79da..8c5386612c 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -9,7 +9,7 @@ RUBY_VERSION_SPLIT = RUBY_VERSION.split "." RUBY_X = RUBY_VERSION_SPLIT[0].to_i RUBY_Y = RUBY_VERSION_SPLIT[1].to_i if RUBY_X < 2 || (RUBY_X == 2 && RUBY_Y < 3) - raise "Homebrew must be run under Ruby 2.3!" + raise "Homebrew must be run under Ruby 2.3! You're running #{RUBY_VERSION}." end require "pathname"