Merge pull request #5868 from kiendang/extract-rename-class

Fix incorrect formula name from file name
This commit is contained in:
Mike McQuaid 2019-03-12 19:20:25 +00:00 committed by GitHub
commit 58ec4098d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,7 +142,7 @@ module Homebrew
# The class name has to be renamed to match the new filename,
# e.g. Foo version 1.2.3 becomes FooAT123 and resides in Foo@1.2.3.rb.
class_name = name.capitalize
class_name = Formulary.class_s(name.to_s)
versioned_name = Formulary.class_s("#{class_name}@#{version}")
result.gsub!("class #{class_name} < Formula", "class #{versioned_name} < Formula")