From 98155a55267e145f2816446913fa0796f49c35a7 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Thu, 25 Aug 2016 20:28:44 +0100 Subject: [PATCH 1/3] formulary: translate @ to AT for classname --- Library/Homebrew/formulary.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 9d385fc514..162385e60d 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -57,6 +57,7 @@ class Formulary class_name = name.capitalize class_name.gsub!(/[-_.\s]([a-zA-Z0-9])/) { $1.upcase } class_name.tr!("+", "x") + class_name.gsub!(/\b@\b/, "AT") class_name end From 24be5c4a392dbe3abb66c765f52cf85cec5e8b8c Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Thu, 25 Aug 2016 20:32:47 +0100 Subject: [PATCH 2/3] test_formulary: add formula@version class translation check --- Library/Homebrew/test/test_formulary.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/test/test_formulary.rb b/Library/Homebrew/test/test_formulary.rb index 7a3ab65e0a..abc034e14b 100644 --- a/Library/Homebrew/test/test_formulary.rb +++ b/Library/Homebrew/test/test_formulary.rb @@ -10,6 +10,7 @@ class FormularyTest < Homebrew::TestCase assert_equal "SLang", Formulary.class_s("s-lang") assert_equal "PkgConfig", Formulary.class_s("pkg-config") assert_equal "FooBar", Formulary.class_s("foo_bar") + assert_equal "OpensslAT11", Formulary.class_s("openssl@1.1") end end From ab203a749f050486bd174fc7e29bd2a246333b80 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Thu, 25 Aug 2016 20:40:26 +0100 Subject: [PATCH 3/3] search: handle name@v.v formulae. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this change: ``` ~> brew search openssl@1.1 openssl@1.1 ✔ ==> Did you mean to perform a regular expression search? ==> Surround your query with /slashes/ to search by regex. ``` --- Library/Homebrew/cmd/search.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 526c7220d6..2a100083d1 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -83,7 +83,7 @@ module Homebrew end if $stdout.tty? - metacharacters = %w[\\ | ( ) [ ] { } ^ $ * + ? .] + metacharacters = %w[\\ | ( ) [ ] { } ^ $ * + ?] bad_regex = metacharacters.any? do |char| ARGV.any? do |arg| arg.include?(char) && !arg.start_with?("/")