Merge pull request #812 from DomT4/at

formulary: handle @ formulae.
This commit is contained in:
Dominyk Tiller 2016-08-28 05:01:14 +01:00 committed by GitHub
commit 8e29cf1b1d
3 changed files with 3 additions and 1 deletions

View File

@ -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?("/")

View File

@ -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

View File

@ -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