From 72f350e7578022f9a0b7bec4a86b948b203721fc Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 17 Sep 2018 19:30:00 +0200 Subject: [PATCH] =?UTF-8?q?Use=20ActiveSupport=E2=80=99s=20`#second=5Fto?= =?UTF-8?q?=5Flast`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Homebrew/global.rb | 1 + Library/Homebrew/tab.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 2ca701c870..3ed18d7229 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -8,6 +8,7 @@ require "pp" require_relative "load_path" require "active_support/core_ext/numeric/time" +require "active_support/core_ext/array/access" require "config" require "os" require "extend/ARGV" diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 76ba9ebb0f..daac01b7e5 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -78,7 +78,7 @@ class Tab < OpenStruct end if attributes["source"]["spec"].nil? - version = PkgVersion.parse path.to_s.split("/")[-2] + version = PkgVersion.parse path.to_s.split("/").second_to_last if version.head? attributes["source"]["spec"] = "head" else